This commit is contained in:
DominicKarma42 committed 2020-04-21 14:28:36 -05:00
commit 77158fa920
63 files changed
+1170 -219

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
using CalamityMod.Projectiles.Pets;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Pets
{
public class LadBuff : ModBuff
{
public override void SetDefaults()
{
DisplayName.SetDefault("The Father");
Description.SetDefault("A father of many floats around you");
Main.buffNoTimeDisplay[Type] = true;
Main.vanityPet[Type] = true;
}
public override void Update(Player player, ref int buffIndex)
{
player.buffTime[buffIndex] = 18000;
player.Calamity().ladShark = true;
bool petProjectileNotSpawned = player.ownedProjectileCounts[ModContent.ProjectileType<LadShark>()] <= 0;
if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer)
{
Projectile.NewProjectile(player.position.X + (float)(player.width / 2), player.position.Y + (float)(player.height / 2), 0f, 0f, ModContent.ProjectileType<LadShark>(), 0, 0f, player.whoAmI, 0f, 0f);
}
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 418 B

+163 -50
View File
@@ -11,6 +11,7 @@ using CalamityMod.Items.Accessories.Vanity;
using CalamityMod.Items.DifficultyItems;
using CalamityMod.Items.Fishing.BrimstoneCragCatches;
using CalamityMod.Items.Mounts;
using CalamityMod.Items.Pets;
using CalamityMod.Items.TreasureBags;
using CalamityMod.Items.Weapons.Magic;
using CalamityMod.Items.Weapons.Melee;
@@ -242,6 +243,8 @@ namespace CalamityMod.CalPlayer
public bool leviPet = false;
public bool plaguebringerBab = false;
public bool rotomPet = false;
public bool ladShark = false;
public int ladHearts = 0;
public bool sparks = false;
public bool sirenPet = false;
public bool fox = false;
@@ -517,6 +520,8 @@ namespace CalamityMod.CalPlayer
#region Armor Set
public bool snowRuffianSet = false;
public bool forbiddenCirclet = false;
public int forbiddenCooldown = 0;
public bool eskimoSet = false; //vanilla armor
public bool meteorSet = false; //vanilla armor, for space gun nerf
public bool victideSet = false;
@@ -684,6 +689,7 @@ namespace CalamityMod.CalPlayer
public bool yPower = false;
public bool aWeapon = false;
public bool tScale = false;
public int titanBoost = 0;
public bool fabsolVodka = false;
public bool mushy = false;
public bool molten = false;
@@ -1254,6 +1260,7 @@ namespace CalamityMod.CalPlayer
leviPet = false;
plaguebringerBab = false;
rotomPet = false;
ladShark = false;
sparks = false;
sirenPet = false;
fox = false;
@@ -1514,6 +1521,8 @@ namespace CalamityMod.CalPlayer
snowRuffianSet = false;
forbiddenCirclet = false;
eskimoSet = false; //vanilla armor
meteorSet = false; //vanilla armor, for Space Gun nerf
@@ -1858,6 +1867,8 @@ namespace CalamityMod.CalPlayer
hallowedRuneCooldown = 0;
doubledHorror = false;
sulphurBubbleCooldown = 0;
forbiddenCooldown = 0;
ladHearts = 0;
alcoholPoisoning = false;
shadowflame = false;
@@ -1980,6 +1991,7 @@ namespace CalamityMod.CalPlayer
yPower = false;
aWeapon = false;
tScale = false;
titanBoost = 0;
fabsolVodka = false;
invincible = false;
shine = false;
@@ -2086,6 +2098,7 @@ namespace CalamityMod.CalPlayer
ataxiaBlaze = false;
hydrothermalSmoke = false;
snowRuffianSet = false;
forbiddenCirclet = false;
eskimoSet = false; //vanilla armor
meteorSet = false; //vanilla armor, for Space Gun nerf
victideSet = false;
@@ -2349,6 +2362,8 @@ namespace CalamityMod.CalPlayer
if (!mediumcoreDeath)
{
if (player.name == "Aleksh" || player.name == "Shark Lad")
items.Add(createItem(ModContent.ItemType<JoyfulHeart>()));
items.Add(createItem(ModContent.ItemType<StarterBag>()));
items.Add(createItem(ModContent.ItemType<Revenge>()));
items.Add(createItem(ModContent.ItemType<IronHeart>()));
@@ -2559,11 +2574,10 @@ namespace CalamityMod.CalPlayer
double startAngle = Math.Atan2(player.velocity.X, player.velocity.Y) - spread / 2;
double deltaAngle = spread / 8f;
double offsetAngle;
int i;
int damage = (int)(800 * player.RangedDamage());
if (player.whoAmI == Main.myPlayer)
{
for (i = 0; i < 8; i++)
for (int i = 0; i < 8; i++)
{
float ai1 = Main.rand.NextFloat() + 0.5f;
float randomSpeed = (float)Main.rand.Next(1, 7);
@@ -2629,6 +2643,34 @@ namespace CalamityMod.CalPlayer
}
if (plagueReaper && plagueReaperCooldown <= 0)
plagueReaperCooldown = 1800;
if (forbiddenCirclet)
{
int stormMana = (int)(ForbiddenCirclet.manaCost * player.manaCost);
if (player.statMana < stormMana)
{
if (player.manaFlower)
{
player.QuickMana();
}
}
if (player.statMana >= stormMana)
{
player.manaRegenDelay = (int)player.maxRegenDelay;
player.statMana -= stormMana;
float dmgMult = player.RogueDamage() + player.minionDamage - 1f;
int damage = (int)(ForbiddenCirclet.tornadoBaseDmg * dmgMult);
if (player.HasBuff(BuffID.ManaSickness))
{
int sickPenalty = (int)(damage * (0.05f * ((player.buffTime[player.FindBuffIndex(BuffID.ManaSickness)] + 60) / 60)));
damage -= sickPenalty;
}
float kBack = ForbiddenCirclet.tornadoBaseKB + player.minionKB;
if (player.whoAmI == Main.myPlayer)
{
Projectile.NewProjectile(Main.MouseWorld, Vector2.Zero, ModContent.ProjectileType<CircletMark>(), damage, kBack, player.whoAmI, 0f, 0f);
}
}
}
}
if (CalamityMod.AstralArcanumUIHotkey.JustPressed && astralArcanum)
{
@@ -3782,22 +3824,6 @@ namespace CalamityMod.CalPlayer
#region Get Weapon Damage And KB
public override void ModifyWeaponDamage(Item item, ref float add, ref float mult, ref float flat)
{
bool isTrueMelee = item.melee && (item.shoot == 0 || item.Calamity().trueMelee);
if (isTrueMelee)
{
if (tScale)
{
player.statDefense += 25;
player.endurance += 0.1f;
}
float damageAdd = (dodgeScarf ? 0.2f : 0f) +
((aBulwarkRare && aBulwarkRareMeleeBoostTimer > 0) ? 2f : 0f) +
(DoGLore ? 0.5f : 0f) +
(fungalSymbiote ? 0.25f : 0f);
add += damageAdd;
}
if (item.type == ModContent.ItemType<GaelsGreatsword>())
{
add += GaelsGreatsword.BaseDamage / (float)GaelsGreatsword.BaseDamage - 1f;
@@ -3909,8 +3935,7 @@ namespace CalamityMod.CalPlayer
}
}
}
bool isTrueMelee = item.melee && (item.shoot == 0 || item.Calamity().trueMelee);
if (isTrueMelee)
if (item.melee)
{
if (fungalSymbiote && player.whoAmI == Main.myPlayer)
{
@@ -4038,6 +4063,9 @@ namespace CalamityMod.CalPlayer
if (!item.melee && (int) player.meleeEnchant == 7)
Projectile.NewProjectile(target.Center.X, target.Center.Y, target.velocity.X, target.velocity.Y, ProjectileID.ConfettiMelee, 0, 0f, player.whoAmI, 0f, 0f);
if (item.melee)
titanBoost = 600;
if (omegaBlueChestplate)
target.AddBuff(ModContent.BuffType<CrushDepth>(), 240);
if (sulfurSet)
@@ -4209,6 +4237,9 @@ namespace CalamityMod.CalPlayer
if (!proj.npcProj && !proj.trap)
{
if (proj.Calamity().trueMelee)
titanBoost = 600;
if (sulfurSet && proj.friendly && !target.friendly)
target.AddBuff(BuffID.Poisoned, 120);
if (omegaBlueChestplate && proj.friendly && !target.friendly)
@@ -4366,6 +4397,9 @@ namespace CalamityMod.CalPlayer
if (!item.melee && (int) player.meleeEnchant == 7)
Projectile.NewProjectile(target.Center.X, target.Center.Y, target.velocity.X, target.velocity.Y, ProjectileID.ConfettiMelee, 0, 0f, player.whoAmI, 0f, 0f);
if (item.melee)
titanBoost = 600;
if (omegaBlueChestplate)
target.AddBuff(ModContent.BuffType<CrushDepth>(), 240);
if (sulfurSet)
@@ -4524,6 +4558,9 @@ namespace CalamityMod.CalPlayer
if (!proj.npcProj && !proj.trap)
{
if (proj.Calamity().trueMelee)
titanBoost = 600;
if (sulfurSet && proj.friendly)
target.AddBuff(BuffID.Poisoned, 120);
if (omegaBlueChestplate && proj.friendly)
@@ -4679,14 +4716,21 @@ namespace CalamityMod.CalPlayer
#region Modify Hit NPC
public override void ModifyHitNPC(Item item, NPC target, ref int damage, ref float knockback, ref bool crit)
{
bool isTrueMelee = item.melee && item.shoot == 0;
#region MultiplierBoosts
double damageMult = 1.0;
if (silvaMelee && Main.rand.NextBool(4) && item.melee)
{
damageMult += 4.0;
}
if (item.melee)
{
double damageAdd = (dodgeScarf ? 0.2 : 0) +
((aBulwarkRare && aBulwarkRareMeleeBoostTimer > 0) ? 2 : 0) +
(DoGLore ? 0.5 : 0) +
(fungalSymbiote ? 0.25 : 0);
damageMult += damageAdd;
}
if (enraged && !CalamityMod.CalamityConfig.BossRushXerocCurse)
{
damageMult += 1.25;
@@ -4755,7 +4799,7 @@ namespace CalamityMod.CalPlayer
if ((target.damage > 5 || target.boss) && player.whoAmI == Main.myPlayer && !target.SpawnedFromStatue)
{
if (isTrueMelee && soaring)
if (item.melee && soaring)
{
double useTimeMultiplier = 0.85 + (item.useTime * item.useAnimation / 3600D); //28 * 28 = 784 is average so that equals 784 / 3600 = 0.217777 + 1 = 21.7% boost
double wingTimeFraction = player.wingTimeMax / 20D;
@@ -4776,21 +4820,21 @@ namespace CalamityMod.CalPlayer
Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, ModContent.ProjectileType<ChaosGeyser>(), (int)(damage * 0.15), 2f, player.whoAmI, 0f, 0f);
}
}
if (unstablePrism && crit)
{
for (int num252 = 0; num252 < 3; num252++)
{
Vector2 value15 = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51));
while (value15.X == 0f && value15.Y == 0f)
{
value15 = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51));
}
value15.Normalize();
value15 *= (float)Main.rand.Next(30, 61) * 0.1f;
Projectile.NewProjectile(target.Center.X, target.Center.Y, value15.X, value15.Y, ModContent.ProjectileType<UnstableSpark>(), (int)(damage * 0.15), 0f, player.whoAmI, 0f, 0f);
}
}
}
}
if (unstablePrism && crit)
{
for (int num252 = 0; num252 < 3; num252++)
{
Vector2 value15 = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51));
while (value15.X == 0f && value15.Y == 0f)
{
value15 = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51));
}
value15.Normalize();
value15 *= (float)Main.rand.Next(30, 61) * 0.1f;
Projectile.NewProjectile(target.Center.X, target.Center.Y, value15.X, value15.Y, ModContent.ProjectileType<UnstableSpark>(), (int)(damage * 0.15), 0f, player.whoAmI, 0f, 0f);
}
}
if (astralStarRain && crit && astralStarRainCooldown <= 0)
{
astralStarRainCooldown = 60;
@@ -4928,6 +4972,15 @@ namespace CalamityMod.CalPlayer
}
}
}
if (isTrueMelee)
{
double damageAdd = (dodgeScarf ? 0.2 : 0) +
((aBulwarkRare && aBulwarkRareMeleeBoostTimer > 0) ? 2 : 0) +
(DoGLore ? 0.5 : 0) +
(fungalSymbiote ? 0.25 : 0);
damageMult += damageAdd;
}
if (screwdriver)
{
if (proj.penetrate > 1 || proj.penetrate == -1)
@@ -5129,20 +5182,22 @@ namespace CalamityMod.CalPlayer
#endregion
#region MultiplicativeReductions
// Forbidden and Fearmonger armor makes you immune to the summoner cross-class nerf
// Fearmonger armor makes you immune to the summoner cross-class nerf
// Forbidden armor makes you immune when holding the respective helmet's preferred weapon type
// Profaned Soul Crystal encourages use of other weapons, nerfing the damage would not make sense.
bool forbidden = player.head == ArmorIDs.Head.AncientBattleArmor && player.body == ArmorIDs.Body.AncientBattleArmor && player.legs == ArmorIDs.Legs.AncientBattleArmor;
if (isSummon && !fearmongerSet && !forbidden && !profanedCrystalBuffs)
if (isSummon && !fearmongerSet && !profanedCrystalBuffs &&
(!forbidden || !heldItem.magic) && (!forbiddenCirclet || !heldItem.Calamity().rogue))
{
if (heldItem.type > 0)
{
if (!heldItem.summon &&
(heldItem.melee || heldItem.ranged || heldItem.magic || heldItem.Calamity().rogue) &&
heldItem.hammer == 0 && heldItem.pick == 0 && heldItem.axe == 0 && heldItem.useStyle != 0)
{
damage = (int)(damage * 0.75);
}
}
if (heldItem.type > 0)
{
if (!heldItem.summon &&
(heldItem.melee || heldItem.ranged || heldItem.magic || heldItem.Calamity().rogue) &&
heldItem.hammer == 0 && heldItem.pick == 0 && heldItem.axe == 0 && heldItem.useStyle != 0)
{
damage = (int)(damage * 0.75);
}
}
}
if (proj.ranged)
{
@@ -8365,6 +8420,59 @@ namespace CalamityMod.CalPlayer
}
});
public static readonly PlayerLayer ForbiddenCircletSign = new PlayerLayer("CalamityMod", "ForbiddenSigil", PlayerLayer.BackAcc, delegate (PlayerDrawInfo drawInfo)
{
DrawData drawData = new DrawData();
Player drawPlayer = drawInfo.drawPlayer;
CalamityPlayer modPlayer = drawPlayer.Calamity();
if (drawInfo.shadow != 0f || drawPlayer.dead || !modPlayer.forbiddenCirclet)
{
return;
}
SpriteEffects spriteEffects = SpriteEffects.FlipHorizontally;
if (drawPlayer.gravDir == 1f)
{
if (drawPlayer.direction == 1)
{
spriteEffects = SpriteEffects.None;
}
else
{
spriteEffects = SpriteEffects.FlipHorizontally;
}
}
else
{
if (drawPlayer.direction == 1)
{
spriteEffects = SpriteEffects.FlipVertically;
}
else
{
spriteEffects = SpriteEffects.FlipHorizontally | SpriteEffects.FlipVertically;
}
}
int dyeShader = 0;
if (drawPlayer.dye[1] != null)
dyeShader = (int)drawPlayer.dye[1].dye;
Microsoft.Xna.Framework.Color color12 = drawPlayer.GetImmuneAlphaPure(Lighting.GetColor((int)((double)drawInfo.position.X + (double)drawPlayer.width * 0.5) / 16, (int)((double)drawInfo.position.Y + (double)drawPlayer.height * 0.5) / 16, Microsoft.Xna.Framework.Color.White), drawInfo.shadow);
Microsoft.Xna.Framework.Color color19 = Microsoft.Xna.Framework.Color.Lerp(color12, Microsoft.Xna.Framework.Color.White, 0.7f);
Texture2D texture = Main.extraTexture[ExtrasID.ForbiddenSign];
Texture2D glowmask = Main.glowMaskTexture[GlowMaskID.ForbiddenSign];
int num24 = (int)(((float)((double)drawPlayer.miscCounter / 300 * MathHelper.TwoPi)).ToRotationVector2().Y * 6f);
float num25 = ((float)((double) drawPlayer.miscCounter / 75.0 * MathHelper.TwoPi)).ToRotationVector2().X * 4f;
Microsoft.Xna.Framework.Color color20 = new Microsoft.Xna.Framework.Color(80, 70, 40, 0) * (float) ((double) num25 / 8.0 + 0.5) * 0.8f;
Vector2 position = new Vector2((float)((double)drawInfo.position.X - (double)Main.screenPosition.X - (double)(drawPlayer.bodyFrame.Width / 2) + (double)(drawPlayer.width / 2)), (float)((double)drawInfo.position.Y - (double)Main.screenPosition.Y + (double)drawPlayer.height - (double)drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)) + new Vector2((float)(-drawPlayer.direction * 10), (float)(num24 - 20));
drawData = new DrawData(texture, position, new Microsoft.Xna.Framework.Rectangle?(), color19, drawPlayer.bodyRotation, texture.Size() / 2f, 1f, spriteEffects, 0);
drawData.shader = dyeShader;
Main.playerDrawData.Add(drawData);
for (float num26 = 0.0f; num26 < 4f; ++num26)
{
drawData = new DrawData(glowmask, position + (num26 * MathHelper.PiOver2).ToRotationVector2() * num25, new Microsoft.Xna.Framework.Rectangle?(), color20, drawPlayer.bodyRotation, texture.Size() / 2f, 1f, spriteEffects, 0);
Main.playerDrawData.Add(drawData);
}
});
public static readonly PlayerLayer Skin = new PlayerLayer("CalamityMod", "Skin", PlayerLayer.Skin, delegate (PlayerDrawInfo drawInfo)
{
Player drawPlayer = drawInfo.drawPlayer;
@@ -8465,6 +8573,11 @@ namespace CalamityMod.CalPlayer
int legsIndex = list.IndexOf(PlayerLayer.Skin);
list.Insert(legsIndex - 1, Tail);
}
if (forbiddenCirclet)
{
int drawTheStupidSign = list.IndexOf(PlayerLayer.Skin);
list.Insert(drawTheStupidSign, ForbiddenCircletSign);
}
list.Add(ColdDivinityOverlay);
list.Add(StratusSphereDrawing);
}
@@ -8989,7 +9102,7 @@ namespace CalamityMod.CalPlayer
fullBright = true;
}
}
if (cadence && !player.loveStruck)
if ((cadence || ladHearts > 0) && !player.loveStruck)
{
if (Main.rand.NextBool(5) && drawInfo.shadow == 0f)
{
+34
View File
@@ -912,6 +912,12 @@ namespace CalamityMod.CalPlayer
modPlayer.hallowedRuneCooldown--;
if (modPlayer.sulphurBubbleCooldown > 0)
modPlayer.sulphurBubbleCooldown--;
if (modPlayer.forbiddenCooldown > 0)
modPlayer.forbiddenCooldown--;
if (modPlayer.ladHearts > 0)
modPlayer.ladHearts--;
if (modPlayer.titanBoost > 0)
modPlayer.titanBoost--;
// Silva invincibility effects
if (modPlayer.silvaCountdown > 0 && modPlayer.hasSilvaEffect && modPlayer.silvaSet)
@@ -1193,6 +1199,12 @@ namespace CalamityMod.CalPlayer
light[2] += 0.9f;
}
}
if (modPlayer.forbiddenCirclet)
{
light[0] += 0.8f;
light[1] += 0.7f;
light[2] += 0.2f;
}
Lighting.AddLight((int)(player.Center.X / 16f), (int)(player.Center.Y / 16f), light[0], light[1], light[2]);
// Blazing Core bonus
@@ -2355,7 +2367,14 @@ namespace CalamityMod.CalPlayer
player.endurance += 0.05f;
player.statDefense += 5;
player.kbBuff = true;
if (modPlayer.titanBoost > 0)
{
player.statDefense += 25;
player.endurance += 0.1f;
}
}
else
modPlayer.titanBoost = 0;
if (modPlayer.darkSunRing)
{
@@ -3438,6 +3457,21 @@ namespace CalamityMod.CalPlayer
#region Limits
private static void Limits(Player player, CalamityPlayer modPlayer)
{
//not sure where else this should go
if (modPlayer.forbiddenCirclet)
{
float rogueDmg = player.thrownDamage + modPlayer.throwingDamage - 1f;
float minionDmg = player.minionDamage;
if (minionDmg < rogueDmg)
{
player.minionDamage = rogueDmg;
}
if (rogueDmg < minionDmg)
{
modPlayer.throwingDamage = minionDmg - player.thrownDamage + 1f;
}
}
if (player.meleeSpeed < 0.5f)
player.meleeSpeed = 0.5f;
+1 -1
View File
@@ -10,7 +10,7 @@ namespace CalamityMod.Items.Accessories
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Counter Scarf");
Tooltip.SetDefault("Melee weapons that don't fire projectiles are granted 20% more damage\n" +
Tooltip.SetDefault("True melee strikes deal 20% more damage\n" +
"Grants the ability to dash; dashing into an attack will cause you to dodge it\n" +
"After a dodge you will be granted a buff to all damage, melee speed, and all crit chance for a short time\n" +
"After a successful dodge you must wait 15 seconds before you can dodge again\n" +
+2 -2
View File
@@ -9,8 +9,8 @@ namespace CalamityMod.Items.Accessories
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Fungal Symbiote");
Tooltip.SetDefault("True melee weapons emit mushrooms when swung\n" +
"Boosts true melee damage by 25%");
Tooltip.SetDefault("Various melee weapons emit mushrooms in true melee range\n" +
"True melee strikes deal 25% more damage");
}
public override void SetDefaults()
+80
View File
@@ -0,0 +1,80 @@
using CalamityMod.CalPlayer;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Armor
{
[AutoloadEquip(EquipType.Head)]
public class ForbiddenCirclet : ModItem
{
public const int manaCost = 50;
public const int tornadoBaseDmg = 100;
public const float tornadoBaseKB = 1f;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Forbidden Circlet");
Tooltip.SetDefault("10% increased summon damage and 15% increased rogue velocity");
}
public override void SetDefaults()
{
item.width = 18;
item.height = 18;
item.defense = 1; //21
//same rarity and sell price as Forbidden Mask
item.value = Item.buyPrice(0, 25, 0, 0);
item.rare = 5;
//I lied, it's patron dark red
item.Calamity().customRarity = CalamityRarity.Dedicated;
}
public override bool IsArmorSet(Item head, Item body, Item legs)
{
return body.type == ItemID.AncientBattleArmorShirt && legs.type == ItemID.AncientBattleArmorPants;
}
public override void ArmorSetShadows(Player player)
{
player.armorEffectDrawShadowLokis = true;
player.armorEffectDrawOutlinesForbidden = true;
}
public override void UpdateArmorSet(Player player)
{
int stormMana = (int)(manaCost * player.manaCost);
string hotkey = CalamityMod.TarraHotKey.TooltipHotkeyString();
player.setBonus = "Press " + hotkey + " to call an ancient storm to the cursor location\n" +
"The ancient storm costs " + stormMana + " mana and benefits from both summon and rogue bonuses\n" +
"Rogue stealth strikes spawn homing eaters on enemy hits\n" +
"Minions deal full damage while wielding rogue weapons\n" +
"Rogue and summon attacks will scale off of the stat with a higher boost\n" +
"Rogue stealth builds while not attacking and slower while moving, up to a max of 100\n" +
"Once you have built max stealth, you will be able to perform a Stealth Strike\n" +
"Rogue stealth only reduces when you attack, it does not reduce while moving\n" +
"The higher your rogue stealth the higher your rogue damage, crit, and movement speed";
CalamityPlayer modPlayer = player.Calamity();
modPlayer.forbiddenCirclet = true;
modPlayer.rogueStealthMax += 1f;
modPlayer.wearingRogueArmor = true;
}
public override void UpdateEquip(Player player)
{
player.minionDamage += 0.1f;
player.Calamity().throwingVelocity += 0.15f;
}
public override void AddRecipes()
{
//Same recipe as Forbidden Mask
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.AncientBattleArmorMaterial);
recipe.AddRecipeGroup("AnyAdamantiteBar", 10);
recipe.AddTile(TileID.MythrilAnvil);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 446 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

+11 -33
View File
@@ -55,7 +55,6 @@ namespace CalamityMod.Items
#endregion
public bool rogue = false;
public bool trueMelee = false;
public int timesUsed = 0;
@@ -184,30 +183,6 @@ namespace CalamityMod.Items
}
if (item.type == ItemID.StarCannon)
item.UseSound = null;
switch (item.type)
{
case ItemID.Spear:
case ItemID.TheRottedFork:
case ItemID.Swordfish:
case ItemID.Arkhalis:
case ItemID.DarkLance:
case ItemID.CobaltNaginata:
case ItemID.PalladiumPike:
case ItemID.MythrilHalberd:
case ItemID.OrichalcumHalberd:
case ItemID.AdamantiteGlaive:
case ItemID.TitaniumTrident:
case ItemID.Gungnir:
case ItemID.ObsidianSwordfish:
case ItemID.MonkStaffT3:
case ItemID.MonkStaffT2:
case ItemID.MonkStaffT1:
trueMelee = true;
break;
default:
break;
}
}
#endregion
@@ -1532,14 +1507,17 @@ namespace CalamityMod.Items
}
if (item.type == ItemID.AncientBattleArmorHat || item.type == ItemID.AncientBattleArmorShirt || item.type == ItemID.AncientBattleArmorPants)
{
foreach (TooltipLine line2 in tooltips)
{
if (line2.mod == "Terraria" && line2.Name == "SetBonus")
{
line2.text = "Set Bonus: Double tap " + (Main.ReversedUpDownArmorSetBonuses ? "UP" : "DOWN") + " to call an ancient storm to the cursor location\n" +
"Minions deal full damage while wielding weaponry";
}
}
if (!Main.player[Main.myPlayer].Calamity().forbiddenCirclet)
{
foreach (TooltipLine line2 in tooltips)
{
if (line2.mod == "Terraria" && line2.Name == "SetBonus")
{
line2.text = "Set Bonus: Double tap " + (Main.ReversedUpDownArmorSetBonuses ? "UP" : "DOWN") + " to call an ancient storm to the cursor location\n" +
"Minions deal full damage while wielding magic weapons";
}
}
}
}
if (item.type == ItemID.GladiatorHelmet)
{
+1 -1
View File
@@ -14,7 +14,7 @@ namespace CalamityMod.Items.LoreItems
DisplayName.SetDefault("The Devourer of Gods");
Tooltip.SetDefault("This serpent’s power to assimilate the abilities and energy of those it consumed is unique in almost all the known cosmos, save for its lesser brethren.\n" +
"I would have soon had to eliminate it as a threat had it been given more time and creatures to feast upon.\n" +
"Place in your inventory to boost your true melee damage by 50%.\n" +
"Place in your inventory to boost the power of your true melee strikes by 50%.\n" +
"However, due to your reckless nature you will take increased damage.");
}
+40
View File
@@ -0,0 +1,40 @@
using CalamityMod.Buffs.Pets;
using CalamityMod.Projectiles.Pets;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Pets
{
public class JoyfulHeart : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Joyful Heart");
Tooltip.SetDefault("It's oddly warm. Attracts the forbidden one.");
}
public override void SetDefaults()
{
item.damage = 0;
item.useStyle = 1;
item.useAnimation = 20;
item.useTime = 20;
item.noMelee = true;
item.width = 30;
item.height = 30;
item.value = Item.sellPrice(0, 1, 0, 0);
item.shoot = ModContent.ProjectileType<LadShark>();
item.buffType = ModContent.BuffType<LadBuff>();
item.rare = 5;
item.UseSound = SoundID.Item2;
}
public override void UseStyle(Player player)
{
if (player.whoAmI == Main.myPlayer && player.itemTime == 0)
{
player.AddBuff(item.buffType, 15, true);
}
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 343 B

+3 -3
View File
@@ -12,9 +12,9 @@ namespace CalamityMod.Items.Potions
{
DisplayName.SetDefault("Draconic Elixir");
Tooltip.SetDefault("Greatly increases wing flight time and speed and increases defense by 16\n" +
"God slayer revival heals you to full HP instead of 150 HP when triggered\n" +
"Silva invincibility heals you to full HP when triggered\n" +
"If you trigger the above heals you cannot drink this potion again for 30 seconds");
"God slayer revival heals you to half HP instead of 150 HP when triggered\n" +
"Silva invincibility heals you to half HP when triggered\n" +
"If you trigger the above heals you cannot drink this potion again for 60 seconds");
}
public override void SetDefaults()
+3 -3
View File
@@ -28,7 +28,7 @@ namespace CalamityMod.Items.Potions
item.UseSound = SoundID.Item3;
item.consumable = true;
item.buffType = ModContent.BuffType<Revivify>();
item.buffTime = 1800;
item.buffTime = 3600;
item.value = Item.buyPrice(0, 2, 0, 0);
}
@@ -41,13 +41,13 @@ namespace CalamityMod.Items.Potions
recipe.AddIngredient(ModContent.ItemType<EssenceofCinder>(), 3);
recipe.AddIngredient(ModContent.ItemType<ScarredAngelfish>());
recipe.AddTile(TileID.AlchemyTable);
recipe.SetResult(this);
recipe.SetResult(this, 5);
recipe.AddRecipe();
recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.HolyWater, 5);
recipe.AddIngredient(ModContent.ItemType<BloodOrb>(), 50);
recipe.AddTile(TileID.AlchemyTable);
recipe.SetResult(this);
recipe.SetResult(this, 5);
recipe.AddRecipe();
}
}
+1 -1
View File
@@ -13,7 +13,7 @@ namespace CalamityMod.Items.Potions
{
DisplayName.SetDefault("Soaring Potion");
Tooltip.SetDefault("Increases flight time and horizontal flight speed by 10%\n" +
"Restores a fraction of your wing flight time whenever you strike an enemy with a true melee weapon\n" +
"Restores a fraction of your wing flight time after a true melee strike\n" +
"The amount of flight time restored scales with your melee stats and weapon swing speed");
}
+1 -1
View File
@@ -13,7 +13,7 @@ namespace CalamityMod.Items.Potions
{
DisplayName.SetDefault("Titan Scale Potion");
Tooltip.SetDefault("Increases knockback, defense by 5, and damage reduction by 5%\n" +
"Increases defense by 25 and damage reduction by 10% while holding a true melee weapon");
"Increases defense by 25 and damage reduction by 10% for a few seconds after a true melee strike");
}
public override void SetDefaults()
-1
View File
@@ -44,7 +44,6 @@ namespace CalamityMod.Items.SummonItems
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.HellstoneBar, 10);
recipe.AddIngredient(ModContent.ItemType<EssenceofChaos>(), 7);
recipe.AddIngredient(ItemID.SoulofFright, 5);
recipe.AddIngredient(ModContent.ItemType<BlightedLens>(), 3);
recipe.AddTile(TileID.MythrilAnvil);
recipe.SetResult(this);
-4
View File
@@ -34,10 +34,6 @@ namespace CalamityMod.Items.Tools
item.rare = 5;
item.UseSound = SoundID.Item1;
item.autoReuse = true;
// This item is not true melee. Its sparks go a very long distnce.
item.shoot = ModContent.ProjectileType<NobodyKnows>();
item.shootSpeed = 0f;
}
public override void AddRecipes()
+3 -3
View File
@@ -53,7 +53,7 @@ namespace CalamityMod.Items.Weapons.Magic
{
if (player.altFunctionUse == 2)
{
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<BigBeamofDeath>(), (int)((double)damage * 2.1), knockBack, player.whoAmI, 0.0f, 0.0f);
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<BigBeamofDeath>(), (int)(damage * 1.8), knockBack, player.whoAmI, 0.0f, 0.0f);
}
else
{
@@ -72,8 +72,8 @@ namespace CalamityMod.Items.Weapons.Magic
{
value9 -= vector7;
}
Projectile.NewProjectile(vector2.X + value9.X, vector2.Y + value9.Y, speedX, speedY, type, (int)((double)damage * 0.8), knockBack, player.whoAmI, 0.0f, 0.0f);
int laser = Projectile.NewProjectile(vector2.X + value9.X, vector2.Y + value9.Y, speedX * 2f, speedY * 2f, ProjectileID.LaserMachinegunLaser, (int)((double)damage * 0.4), knockBack, player.whoAmI, 0.0f, 0.0f);
Projectile.NewProjectile(vector2.X + value9.X, vector2.Y + value9.Y, speedX, speedY, type, (int)(damage * 0.8), knockBack, player.whoAmI, 0.0f, 0.0f);
int laser = Projectile.NewProjectile(vector2.X + value9.X, vector2.Y + value9.Y, speedX * 2f, speedY * 2f, ProjectileID.LaserMachinegunLaser, (int)(damage * 0.4), knockBack, player.whoAmI, 0.0f, 0.0f);
Main.projectile[laser].timeLeft = 120;
Main.projectile[laser].tileCollide = false;
}
-1
View File
@@ -32,7 +32,6 @@ namespace CalamityMod.Items.Weapons.Melee
item.rare = 5;
item.shoot = ModContent.ProjectileType<BrimlanceProj>();
item.shootSpeed = 12f;
item.Calamity().trueMelee = true;
}
}
}
-1
View File
@@ -38,7 +38,6 @@ namespace CalamityMod.Items.Weapons.Melee
item.shoot = ModContent.ProjectileType<DevilsSunriseProj>();
item.shootSpeed = 24f;
item.Calamity().trueMelee = true;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
-1
View File
@@ -32,7 +32,6 @@ namespace CalamityMod.Items.Weapons.Melee
item.rare = 8;
item.shoot = ModContent.ProjectileType<DiseasedPikeSpear>();
item.shootSpeed = 10f;
item.Calamity().trueMelee = true;
}
public override bool CanUseItem(Player player)
@@ -33,7 +33,6 @@ namespace CalamityMod.Items.Weapons.Melee
item.rare = 8;
item.shoot = ModContent.ProjectileType<ExsanguinationLanceProjectile>();
item.shootSpeed = 8f;
item.Calamity().trueMelee = true;
}
public override bool CanUseItem(Player player)
@@ -31,7 +31,6 @@ namespace CalamityMod.Items.Weapons.Melee
item.value = Item.buyPrice(0, 36, 0, 0);
item.rare = 5;
item.shootSpeed = 6f;
item.Calamity().trueMelee = true;
}
public override bool AltFunctionUse(Player player)
-1
View File
@@ -34,7 +34,6 @@ namespace CalamityMod.Items.Weapons.Melee
item.shoot = ModContent.ProjectileType<GildedProboscisProj>();
item.shootSpeed = 13f;
item.Calamity().customRarity = CalamityRarity.Turquoise;
item.Calamity().trueMelee = true;
}
public override bool CanUseItem(Player player)
-1
View File
@@ -32,7 +32,6 @@ namespace CalamityMod.Items.Weapons.Melee
item.rare = 5;
item.shoot = ModContent.ProjectileType<HeartRapierProjectile>();
item.shootSpeed = 5f;
item.Calamity().trueMelee = true;
}
public override void AddRecipes()
-1
View File
@@ -31,7 +31,6 @@ namespace CalamityMod.Items.Weapons.Melee
item.rare = 2;
item.shoot = ModContent.ProjectileType<MarniteSpearProjectile>();
item.shootSpeed = 5f;
item.Calamity().trueMelee = true;
}
public override void AddRecipes()
-1
View File
@@ -34,7 +34,6 @@ namespace CalamityMod.Items.Weapons.Melee
item.shoot = ModContent.ProjectileType<MurasamaProj>();
item.shootSpeed = 24f;
item.Calamity().customRarity = CalamityRarity.Violet;
item.Calamity().trueMelee = true;
}
public override bool CanUseItem(Player player)
-1
View File
@@ -33,7 +33,6 @@ namespace CalamityMod.Items.Weapons.Melee
item.rare = 3;
item.shoot = ModContent.ProjectileType<SausageMakerSpear>();
item.shootSpeed = 6f;
item.Calamity().trueMelee = true;
}
public override void AddRecipes()
+16 -20
View File
@@ -30,69 +30,65 @@ namespace CalamityMod.Items.Weapons.Melee
item.value = Item.buyPrice(0, 80, 0, 0);
item.autoReuse = true;
item.UseSound = SoundID.Item1;
// This item is not true melee.
item.shoot = ModContent.ProjectileType<NobodyKnows>();
item.shootSpeed = 0f;
}
public override void MeleeEffects(Player player, Rectangle hitbox)
{
if (player.whoAmI == Main.myPlayer)
{
if (player.itemAnimation == (int)((double)player.itemAnimationMax * 0.1) ||
player.itemAnimation == (int)((double)player.itemAnimationMax * 0.3) ||
player.itemAnimation == (int)((double)player.itemAnimationMax * 0.5) ||
player.itemAnimation == (int)((double)player.itemAnimationMax * 0.7) ||
player.itemAnimation == (int)((double)player.itemAnimationMax * 0.9))
if (player.itemAnimation == (int)(player.itemAnimationMax * 0.1) ||
player.itemAnimation == (int)(player.itemAnimationMax * 0.3) ||
player.itemAnimation == (int)(player.itemAnimationMax * 0.5) ||
player.itemAnimation == (int)(player.itemAnimationMax * 0.7) ||
player.itemAnimation == (int)(player.itemAnimationMax * 0.9))
{
float num339 = 0f;
float num340 = 0f;
float num341 = 0f;
float num342 = 0f;
if (player.itemAnimation == (int)((double)player.itemAnimationMax * 0.9))
if (player.itemAnimation == (int)(player.itemAnimationMax * 0.9))
{
num339 = -7f;
}
if (player.itemAnimation == (int)((double)player.itemAnimationMax * 0.7))
if (player.itemAnimation == (int)(player.itemAnimationMax * 0.7))
{
num339 = -6f;
num340 = 2f;
}
if (player.itemAnimation == (int)((double)player.itemAnimationMax * 0.5))
if (player.itemAnimation == (int)(player.itemAnimationMax * 0.5))
{
num339 = -4f;
num340 = 4f;
}
if (player.itemAnimation == (int)((double)player.itemAnimationMax * 0.3))
if (player.itemAnimation == (int)(player.itemAnimationMax * 0.3))
{
num339 = -2f;
num340 = 6f;
}
if (player.itemAnimation == (int)((double)player.itemAnimationMax * 0.1))
if (player.itemAnimation == (int)(player.itemAnimationMax * 0.1))
{
num340 = 7f;
}
if (player.itemAnimation == (int)((double)player.itemAnimationMax * 0.7))
if (player.itemAnimation == (int)(player.itemAnimationMax * 0.7))
{
num342 = 26f;
}
if (player.itemAnimation == (int)((double)player.itemAnimationMax * 0.3))
if (player.itemAnimation == (int)(player.itemAnimationMax * 0.3))
{
num342 -= 4f;
num341 -= 20f;
}
if (player.itemAnimation == (int)((double)player.itemAnimationMax * 0.1))
if (player.itemAnimation == (int)(player.itemAnimationMax * 0.1))
{
num341 += 6f;
}
if (player.direction == -1)
{
if (player.itemAnimation == (int)((double)player.itemAnimationMax * 0.9))
if (player.itemAnimation == (int)(player.itemAnimationMax * 0.9))
{
num342 -= 8f;
}
if (player.itemAnimation == (int)((double)player.itemAnimationMax * 0.7))
if (player.itemAnimation == (int)(player.itemAnimationMax * 0.7))
{
num342 -= 6f;
}
@@ -102,7 +98,7 @@ namespace CalamityMod.Items.Weapons.Melee
num342 *= (float)player.direction;
num341 *= player.gravDir;
Projectile.NewProjectile((float)(hitbox.X + hitbox.Width / 2) + num342, (float)(hitbox.Y + hitbox.Height / 2) + num341,
(float)player.direction * num340, num339 * player.gravDir, ModContent.ProjectileType<UltimusCleaverDust>(), (int)(item.damage * (player.allDamage + player.meleeDamage - 1f) * 0.1f), 0f, player.whoAmI, 0f, 0f);
(float)player.direction * num340, num339 * player.gravDir, ModContent.ProjectileType<UltimusCleaverDust>(), (int)(item.damage * player.MeleeDamage() * 0.1f), 0f, player.whoAmI, 0f, 0f);
}
}
}
-2
View File
@@ -60,7 +60,6 @@ namespace CalamityMod.Items.Weapons.Melee
item.useAnimation = 33;
item.useTime = 33;
item.shootSpeed = 4.5f;
item.Calamity().trueMelee = true;
}
else
{
@@ -69,7 +68,6 @@ namespace CalamityMod.Items.Weapons.Melee
item.useAnimation = 22;
item.useTime = 22;
item.shootSpeed = ShootSpeed;
item.Calamity().trueMelee = false;
}
return base.CanUseItem(player);
}
@@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Summon
item.UseSound = SoundID.DD2_BetsyFlyingCircleAttack;
item.summon = true;
item.mana = 11;
item.damage = 301;
item.damage = 275;
item.knockBack = 2f;
item.autoReuse = true;
item.useTime = item.useAnimation = 10;
+11
View File
@@ -586,6 +586,10 @@ namespace CalamityMod
if (setBonus == "mollusk")
return mp.molluskSet;
// Forbidden Circlet
if (setBonus == "forbidden_circlet" || setBonus == "forbidden circlet")
return mp.forbiddenCirclet;
// Daedalus
switch (setBonus)
{
@@ -890,6 +894,13 @@ namespace CalamityMod
return true;
}
// Forbidden Circlet
if (setBonus == "forbidden_circlet" || setBonus == "forbidden circlet")
{
mp.forbiddenCirclet = enabled;
return true;
}
// Daedalus
switch (setBonus)
{
+1
View File
@@ -33,6 +33,7 @@ namespace CalamityMod.NPCs.AcidRain
npc.DeathSound = SoundID.NPCDeath1;
npc.catchItem = (short)ModContent.ItemType<BloodwormItem>();
npc.dontTakeDamageFromHostiles = true;
npc.rarity = 4;
}
public override void AI()
@@ -205,16 +205,6 @@ namespace CalamityMod.NPCs.BrimstoneElemental
DropHelper.DropItemChance(npc, ModContent.ItemType<BrimstoneWaifuMask>(), 7);
}
// if prime hasn't been killed and this is the first time killing brimmy, do the message
string key = "Mods.CalamityMod.SteelSkullBossText";
Color messageColor = Color.Crimson;
if (!NPC.downedMechBoss3 && !CalamityWorld.downedBrimstoneElemental)
{
if (Main.netMode == NetmodeID.SinglePlayer)
Main.NewText(Language.GetTextValue(key), messageColor);
else if (Main.netMode == NetmodeID.Server)
NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor);
}
//if brimmy hasn't been killed, you can mine charred ore
string key2 = "Mods.CalamityMod.BrimmyBossText";
Color messageColor2 = Color.Crimson;
+21 -1
View File
@@ -138,6 +138,7 @@ namespace CalamityMod.NPCs
public int shellfishVore = 0;
public int clamDebuff = 0;
public int sulphurPoison = 0;
public int ladHearts = 0;
// whoAmI Variables
public static int[] bobbitWormBottom = new int[5];
@@ -2448,12 +2449,16 @@ namespace CalamityMod.NPCs
break;
case NPCID.ArmsDealer:
switch (Main.rand.Next(25)) // 24 arms dealer names
switch (Main.rand.Next(26)) // 24 arms dealer names
{
case 0:
npc.GivenName = "Drifter";
break;
case 1:
npc.GivenName = "Finchi";
break;
default:
break;
}
@@ -3039,6 +3044,8 @@ namespace CalamityMod.NPCs
clamDebuff--;
if (sulphurPoison > 0)
sulphurPoison--;
if (ladHearts > 0)
ladHearts--;
// Bosses and any specific other NPCs are completely immune to having their movement impaired.
if (npc.boss || CalamityMod.movementImpairImmuneList.Contains(npc.type))
@@ -4374,6 +4381,19 @@ namespace CalamityMod.NPCs
}
}
}
if (ladHearts > 0 && !npc.loveStruck)
{
if (Main.rand.NextBool(5))
{
Vector2 vector2_2 = new Vector2((float)Main.rand.Next(-10, 11), (float)Main.rand.Next(-10, 11));
vector2_2.Normalize();
vector2_2.X *= 0.66f;
int heart = Gore.NewGore(npc.position + new Vector2((float)Main.rand.Next(npc.width + 1), (float)Main.rand.Next(npc.height + 1)), vector2_2 * (float)Main.rand.Next(3, 6) * 0.33f, 331, (float)Main.rand.Next(40, 121) * 0.01f);
Main.gore[heart].sticky = false;
Main.gore[heart].velocity *= 0.4f;
Main.gore[heart].velocity.Y -= 0.6f;
}
}
if (gState > 0 || eFreeze > 0)
{
+6 -16
View File
@@ -177,15 +177,19 @@ namespace CalamityMod.NPCs
// First kill text (this is not a loot function)
if (!Main.hardMode)
{
string key2 = "Mods.CalamityMod.UglyBossText";
string key2 = "Mods.CalamityMod.UglyBossText"; //Sunken Sea buff
string key = "Mods.CalamityMod.SteelSkullBossText"; //clone can now be fought
Color messageColor2 = Color.Aquamarine;
Color messageColor = Color.Crimson;
if (Main.netMode == NetmodeID.SinglePlayer)
{
Main.NewText(Language.GetTextValue(key2), messageColor2);
Main.NewText(Language.GetTextValue(key), messageColor);
}
else if (Main.netMode == NetmodeID.Server)
{
NetMessage.BroadcastChatMessage(NetworkText.FromKey(key2), messageColor2);
NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor);
}
}
}
@@ -216,21 +220,6 @@ namespace CalamityMod.NPCs
npc.Calamity().SetNewShopVariable(new int[] { NPCID.DD2Bartender, NPCID.Stylist, NPCID.Truffle, ModContent.NPCType<THIEF>() }, NPC.downedMechBossAny);
npc.Calamity().SetNewShopVariable(new int[] { NPCID.Stylist, ModContent.NPCType<DILF>(), ModContent.NPCType<FAP>(), ModContent.NPCType<THIEF>() }, !NPC.downedMechBoss1 || !NPC.downedMechBoss2 || NPC.downedMechBoss3);
npc.Calamity().SetNewShopVariable(new int[] { NPCID.Steampunker }, NPC.downedMechBoss3 || !CalamityMod.CalamityConfig.SellBossSummons);
// If neither Prime nor Brimmy have been killed, show this text (not a loot function)
string key = "Mods.CalamityMod.SteelSkullBossText";
Color messageColor = Color.Crimson;
if (!NPC.downedMechBoss3 && !CalamityWorld.downedBrimstoneElemental)
{
if (Main.netMode == NetmodeID.SinglePlayer)
{
Main.NewText(Language.GetTextValue(key), messageColor);
}
else if (Main.netMode == NetmodeID.Server)
{
NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor);
}
}
}
else if (npc.type == NPCID.Plantera)
{
@@ -1482,6 +1471,7 @@ namespace CalamityMod.NPCs
case NPCID.Shark:
DropHelper.DropItemChance(npc, ItemID.SharkToothNecklace, Main.expertMode ? 20 : 30);
DropHelper.DropItemChance(npc, ModContent.ItemType<JoyfulHeart>(), Main.expertMode ? 20 : 30);
break;
case NPCID.PresentMimic:
+105 -55
View File
@@ -74,6 +74,7 @@ namespace CalamityMod.Projectiles
switch (projectile.type)
{
case ProjectileID.Spear:
case ProjectileID.Trident:
case ProjectileID.TheRottedFork:
case ProjectileID.Swordfish:
case ProjectileID.Arkhalis:
@@ -84,11 +85,42 @@ namespace CalamityMod.Projectiles
case ProjectileID.OrichalcumHalberd:
case ProjectileID.AdamantiteGlaive:
case ProjectileID.TitaniumTrident:
case ProjectileID.MushroomSpear:
case ProjectileID.Gungnir:
case ProjectileID.ObsidianSwordfish:
case ProjectileID.MonkStaffT3:
case ProjectileID.MonkStaffT2:
case ProjectileID.ChlorophytePartisan:
case ProjectileID.MonkStaffT1:
case ProjectileID.MonkStaffT2:
case ProjectileID.MonkStaffT3:
case ProjectileID.NorthPoleWeapon:
//tools
case ProjectileID.CobaltDrill:
case ProjectileID.MythrilDrill:
case ProjectileID.AdamantiteDrill:
case ProjectileID.PalladiumDrill:
case ProjectileID.OrichalcumDrill:
case ProjectileID.TitaniumDrill:
case ProjectileID.ChlorophyteDrill:
case ProjectileID.CobaltChainsaw:
case ProjectileID.MythrilChainsaw:
case ProjectileID.AdamantiteChainsaw:
case ProjectileID.PalladiumChainsaw:
case ProjectileID.OrichalcumChainsaw:
case ProjectileID.TitaniumChainsaw:
case ProjectileID.ChlorophyteChainsaw:
case ProjectileID.VortexDrill:
case ProjectileID.VortexChainsaw:
case ProjectileID.NebulaDrill:
case ProjectileID.NebulaChainsaw:
case ProjectileID.SolarFlareDrill:
case ProjectileID.SolarFlareChainsaw:
case ProjectileID.StardustDrill:
case ProjectileID.StardustChainsaw:
case ProjectileID.Hamdrax:
case ProjectileID.ChlorophyteJackhammer:
case ProjectileID.SawtoothShark:
case ProjectileID.ButchersChainsaw:
trueMelee = true;
break;
case ProjectileID.StarWrath:
@@ -258,8 +290,8 @@ namespace CalamityMod.Projectiles
projectile.position.X += (float)(projectile.width / 2);
projectile.position.Y += (float)(projectile.height / 2);
projectile.scale = ((float)(num606 + num607) - projectile.ai[1]) * num608 / (float)(num607 + num606);
projectile.width = (int)((float)num609 * projectile.scale);
projectile.height = (int)((float)num610 * projectile.scale);
projectile.width = (int)(num609 * projectile.scale);
projectile.height = (int)(num610 * projectile.scale);
projectile.position.X -= (float)(projectile.width / 2);
projectile.position.Y -= (float)(projectile.height / 2);
projectile.netUpdate = true;
@@ -268,8 +300,8 @@ namespace CalamityMod.Projectiles
if (projectile.ai[1] != -1f)
{
projectile.scale = ((float)(num606 + num607) - projectile.ai[1]) * num608 / (float)(num607 + num606);
projectile.width = (int)((float)num609 * projectile.scale);
projectile.height = (int)((float)num610 * projectile.scale);
projectile.width = (int)(num609 * projectile.scale);
projectile.height = (int)(num610 * projectile.scale);
}
if (!Collision.SolidCollision(projectile.position, projectile.width, projectile.height))
@@ -659,8 +691,9 @@ namespace CalamityMod.Projectiles
{
if (projectile.owner == Main.myPlayer && player.ownedProjectileCounts[ProjectileID.Mushroom] < 30)
{
if (projectile.type == ModContent.ProjectileType<Melee.NebulashFlail>() || projectile.type == ModContent.ProjectileType<Melee.CosmicDischargeFlail>() ||
projectile.type == ModContent.ProjectileType<Melee.MourningstarFlail>() || projectile.type == ProjectileID.SolarWhipSword)
//Note: these don't count as true melee anymore but its useful code to keep around
if (projectile.type == ModContent.ProjectileType<NebulashFlail>() || projectile.type == ModContent.ProjectileType<CosmicDischargeFlail>() ||
projectile.type == ModContent.ProjectileType<MourningstarFlail>() || projectile.type == ProjectileID.SolarWhipSword)
{
Vector2 vector24 = Main.OffsetsPlayerOnhand[Main.player[projectile.owner].bodyFrame.Y / 56] * 2f;
if (Main.player[projectile.owner].direction != 1)
@@ -759,9 +792,9 @@ namespace CalamityMod.Projectiles
}
}
if (!projectile.melee && (int) player.meleeEnchant > 0 && !projectile.noEnchantments)
if (!projectile.melee && (int)player.meleeEnchant > 0 && !projectile.noEnchantments)
{
if ((int) player.meleeEnchant == 7) //flask of party affects all types of weapons
if ((int)player.meleeEnchant == 7) //flask of party affects all types of weapons
{
Vector2 velocity = projectile.velocity;
if ((double) velocity.Length() > 4.0)
@@ -788,18 +821,18 @@ namespace CalamityMod.Projectiles
}
}
if (rogue && (int) player.meleeEnchant > 0 && !projectile.noEnchantments)
if (rogue && (int)player.meleeEnchant > 0 && !projectile.noEnchantments)
{
if ((int) player.meleeEnchant == 1 && Main.rand.Next(3) == 0)
if ((int)player.meleeEnchant == 1 && Main.rand.NextBool(3))
{
int index = Dust.NewDust(projectile.position, projectile.width, projectile.height, 171, 0.0f, 0.0f, 100, new Color(), 1f);
Main.dust[index].noGravity = true;
Main.dust[index].fadeIn = 1.5f;
Main.dust[index].velocity *= 0.25f;
}
if ((int) player.meleeEnchant == 1)
if ((int)player.meleeEnchant == 1)
{
if (Main.rand.Next(3) == 0)
if (Main.rand.NextBool(3))
{
int index = Dust.NewDust(projectile.position, projectile.width, projectile.height, 171, 0.0f, 0.0f, 100, new Color(), 1f);
Main.dust[index].noGravity = true;
@@ -807,9 +840,9 @@ namespace CalamityMod.Projectiles
Main.dust[index].velocity *= 0.25f;
}
}
else if ((int) player.meleeEnchant == 2)
else if ((int)player.meleeEnchant == 2)
{
if (Main.rand.Next(2) == 0)
if (Main.rand.NextBool(2))
{
int index = Dust.NewDust(projectile.position, projectile.width, projectile.height, 75, projectile.velocity.X * 0.2f + (float) (projectile.direction * 3), projectile.velocity.Y * 0.2f, 100, new Color(), 2.5f);
Main.dust[index].noGravity = true;
@@ -817,9 +850,9 @@ namespace CalamityMod.Projectiles
Main.dust[index].velocity.Y -= 0.5f;
}
}
else if ((int) player.meleeEnchant == 3)
else if ((int)player.meleeEnchant == 3)
{
if (Main.rand.Next(2) == 0)
if (Main.rand.NextBool(2))
{
int index = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, projectile.velocity.X * 0.2f + (float) (projectile.direction * 3), projectile.velocity.Y * 0.2f, 100, new Color(), 2.5f);
Main.dust[index].noGravity = true;
@@ -827,9 +860,9 @@ namespace CalamityMod.Projectiles
Main.dust[index].velocity.Y -= 0.5f;
}
}
else if ((int) player.meleeEnchant == 4)
else if ((int)player.meleeEnchant == 4)
{
if (Main.rand.Next(2) == 0)
if (Main.rand.NextBool(2))
{
int index = Dust.NewDust(projectile.position, projectile.width, projectile.height, 57, projectile.velocity.X * 0.2f + (float) (projectile.direction * 3), projectile.velocity.Y * 0.2f, 100, new Color(), 1.1f);
Main.dust[index].noGravity = true;
@@ -837,9 +870,9 @@ namespace CalamityMod.Projectiles
Main.dust[index].velocity.Y /= 2f;
}
}
else if ((int) player.meleeEnchant == 5)
else if ((int)player.meleeEnchant == 5)
{
if (Main.rand.Next(2) == 0)
if (Main.rand.NextBool(2))
{
int index = Dust.NewDust(projectile.position, projectile.width, projectile.height, 169, 0.0f, 0.0f, 100, new Color(), 1f);
Main.dust[index].velocity.X += (float) projectile.direction;
@@ -847,9 +880,9 @@ namespace CalamityMod.Projectiles
Main.dust[index].noGravity = true;
}
}
else if ((int) player.meleeEnchant == 6)
else if ((int)player.meleeEnchant == 6)
{
if (Main.rand.Next(2) == 0)
if (Main.rand.NextBool(2))
{
int index = Dust.NewDust(projectile.position, projectile.width, projectile.height, 135, 0.0f, 0.0f, 100, new Color(), 1f);
Main.dust[index].velocity.X += (float) projectile.direction;
@@ -857,7 +890,7 @@ namespace CalamityMod.Projectiles
Main.dust[index].noGravity = true;
}
}
else if ((int) player.meleeEnchant == 8 && Main.rand.Next(4) == 0)
else if ((int)player.meleeEnchant == 8 && Main.rand.NextBool(4))
{
int index = Dust.NewDust(projectile.position, projectile.width, projectile.height, 46, 0.0f, 0.0f, 100, new Color(), 1f);
Main.dust[index].noGravity = true;
@@ -1077,7 +1110,7 @@ namespace CalamityMod.Projectiles
newDamage = (int)((projectile.damage * 0.25 - 30) * 0.1) + 30;
}
int plague = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType<PlagueSeeker>(), newDamage, 0f, projectile.owner, 0f, 0f);
Main.projectile[plague].melee = false;
Main.projectile[plague].Calamity().forceTypeless = false;
}
if (modPlayer.reaverBlast && projectile.melee)
@@ -1449,6 +1482,20 @@ namespace CalamityMod.Projectiles
}
}
if (modPlayer.forbiddenCirclet && stealthStrike && modPlayer.forbiddenCooldown <= 0)
{
for (int index2 = 0; index2 < 6; index2++)
{
float xVector = (float)Main.rand.Next(-35, 36) * 0.02f;
float yVector = (float)Main.rand.Next(-35, 36) * 0.02f;
xVector *= 10f;
yVector *= 10f;
int dmg = (int)(75 + (projectile.damage * 0.05f));
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, xVector, yVector, ModContent.ProjectileType<ForbiddenCircletEater>(), dmg, projectile.knockBack, projectile.owner, 0f, 0f);
modPlayer.forbiddenCooldown = 15;
}
}
if (modPlayer.corrosiveSpine && projectile.type != ModContent.ProjectileType<Corrocloud1>() && projectile.type != ModContent.ProjectileType<Corrocloud2>() && projectile.type != ModContent.ProjectileType<Corrocloud3>())
{
for (int i = 0; i < 3; i++)
@@ -1539,48 +1586,51 @@ namespace CalamityMod.Projectiles
};
if (summonExceptionList.TrueForAll(x => projectile.type != x))
{
if (modPlayer.nucleogenesis)
if (modPlayer.jellyDmg <= 0)
{
if (Main.rand.NextBool(4))
if (modPlayer.nucleogenesis)
{
int newDamage = (int)(projectile.damage * 0.25);
if (newDamage > 100)
if (Main.rand.NextBool(4))
{
newDamage = (int)((projectile.damage * 0.25 - 100) * 0.1) + 100;
int newDamage = (int)(projectile.damage * 0.25);
if (newDamage > 100)
{
newDamage = (int)((projectile.damage * 0.25 - 100) * 0.1) + 100;
}
Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType<ApparatusExplosion>(), newDamage, projectile.knockBack * 0.25f, projectile.owner);
modPlayer.jellyDmg = 20f;
}
Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType<ApparatusExplosion>(), newDamage, projectile.knockBack * 0.25f, projectile.owner);
}
}
else if (modPlayer.starbusterCore)
{
if (Main.rand.NextBool(3))
else if (modPlayer.starbusterCore)
{
int cap = modPlayer.starTaintedGenerator ? 75 : 60;
int newDamage = (int)(projectile.damage * 0.5);
if (newDamage > cap)
if (Main.rand.NextBool(3))
{
newDamage = (int)((projectile.damage * 0.5 - cap) * 0.1) + cap;
int cap = modPlayer.starTaintedGenerator ? 75 : 60;
int newDamage = (int)(projectile.damage * 0.5);
if (newDamage > cap)
{
newDamage = (int)((projectile.damage * 0.5 - cap) * 0.1) + cap;
}
int boom = Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType<SummonAstralExplosion>(),
newDamage, 3f, projectile.owner);
modPlayer.jellyDmg = 20f;
}
int boom = Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType<SummonAstralExplosion>(),
newDamage, 3f, projectile.owner);
}
}
else if (modPlayer.nuclearRod)
{
if (Main.rand.NextBool(3))
else if (modPlayer.nuclearRod)
{
int newDamage = (int)(projectile.damage * 0.25);
if (newDamage > 40)
if (Main.rand.NextBool(3))
{
newDamage = (int)((projectile.damage * 0.25 - 40) * 0.1) + 40;
int newDamage = (int)(projectile.damage * 0.25);
if (newDamage > 40)
{
newDamage = (int)((projectile.damage * 0.25 - 40) * 0.1) + 40;
}
Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType<IrradiatedAura>(),
newDamage, 0f, projectile.owner);
modPlayer.jellyDmg = 20f;
}
Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType<IrradiatedAura>(),
newDamage, 0f, projectile.owner);
}
}
else if (modPlayer.jellyChargedBattery)
{
if (modPlayer.jellyDmg <= 0)
else if (modPlayer.jellyChargedBattery)
{
SpawnOrb(projectile, 1.05f, ModContent.ProjectileType<EnergyOrb>(), 800f, 15f);
int num = (int)(projectile.damage * 0.5f);
@@ -19,6 +19,7 @@ namespace CalamityMod.Projectiles.Melee
projectile.hide = true;
projectile.ownerHitCheck = true;
projectile.melee = true;
projectile.Calamity().trueMelee = true;
}
}
}
@@ -25,6 +25,7 @@ namespace CalamityMod.Projectiles.Melee.Spears
projectile.penetrate = -1;
projectile.ownerHitCheck = true;
projectile.hide = true;
projectile.Calamity().trueMelee = true;
}
public override float InitialSpeed => 3f;
public override float ReelbackSpeed => 1f;
@@ -29,6 +29,7 @@ namespace CalamityMod.Projectiles.Melee.Spears
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = 2;
projectile.alpha = 255;
projectile.Calamity().trueMelee = true;
}
public override SpearType SpearAiType => SpearType.GhastlyGlaiveSpear;
public override float TravelSpeed => 22f;
@@ -25,6 +25,7 @@ namespace CalamityMod.Projectiles.Melee.Spears
projectile.ignoreWater = true;
projectile.penetrate = -1;
projectile.ownerHitCheck = true;
projectile.Calamity().trueMelee = true;
}
public override float InitialSpeed => 3f;
public override float ReelbackSpeed => 2.4f;
@@ -23,6 +23,7 @@ namespace CalamityMod.Projectiles.Melee.Spears
projectile.ignoreWater = true;
projectile.penetrate = -1;
projectile.ownerHitCheck = true;
projectile.Calamity().trueMelee = true;
}
public override float InitialSpeed => 3f;
public override float ReelbackSpeed => 1.1f;
@@ -27,6 +27,7 @@ namespace CalamityMod.Projectiles.Melee.Spears
projectile.ignoreWater = true;
projectile.penetrate = -1;
projectile.ownerHitCheck = true;
projectile.Calamity().trueMelee = true;
}
public override float InitialSpeed => 3f;
@@ -28,6 +28,7 @@ namespace CalamityMod.Projectiles.Melee.Spears
projectile.ownerHitCheck = true;
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = 8;
projectile.Calamity().trueMelee = true;
}
public override float InitialSpeed => 3f;
+1
View File
@@ -27,6 +27,7 @@ namespace CalamityMod.Projectiles.Melee.Spears
projectile.penetrate = -1;
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = 2;
projectile.Calamity().trueMelee = true;
}
public override float InitialSpeed => 5.5f;
public override float ReelbackSpeed => 2.1f;
@@ -29,6 +29,7 @@ namespace CalamityMod.Projectiles.Melee.Spears
projectile.ownerHitCheck = true;
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = 3;
projectile.Calamity().trueMelee = true;
}
public override float InitialSpeed => 3f;
@@ -25,6 +25,7 @@ namespace CalamityMod.Projectiles.Melee.Spears
projectile.ignoreWater = true;
projectile.penetrate = -1;
projectile.ownerHitCheck = true;
projectile.Calamity().trueMelee = true;
}
public override float InitialSpeed => 3f;
public override float ReelbackSpeed => 2.4f;
@@ -30,6 +30,7 @@ namespace CalamityMod.Projectiles.Melee.Spears
projectile.hide = true;
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = 1;
projectile.Calamity().trueMelee = true;
}
public override float InitialSpeed => 3f;
@@ -24,6 +24,7 @@ namespace CalamityMod.Projectiles.Melee.Spears
projectile.ignoreWater = true;
projectile.penetrate = -1;
projectile.ownerHitCheck = true;
projectile.Calamity().trueMelee = true;
}
public override float InitialSpeed => 3f;
public override float ReelbackSpeed => 2.4f;
@@ -25,6 +25,7 @@ namespace CalamityMod.Projectiles.Melee.Spears
projectile.ignoreWater = true;
projectile.penetrate = -1;
projectile.ownerHitCheck = true;
projectile.Calamity().trueMelee = true;
}
public override float InitialSpeed => 3f;
+2 -1
View File
@@ -1,5 +1,6 @@
using CalamityMod.CalPlayer;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Pets
{
@@ -19,7 +20,7 @@ namespace CalamityMod.Projectiles.Pets
projectile.height = 32;
projectile.friendly = true;
projectile.aiStyle = 26;
aiType = 334;
aiType = ProjectileID.Puppy;
projectile.penetrate = -1;
projectile.timeLeft *= 5;
}
+89
View File
@@ -0,0 +1,89 @@
using CalamityMod.CalPlayer;
using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Pets
{
public class LadShark : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Lad Shark");
Main.projPet[projectile.type] = true;
}
public override void SetDefaults()
{
projectile.netImportant = true;
projectile.width = 30;
projectile.height = 30;
projectile.friendly = true;
projectile.penetrate = -1;
projectile.timeLeft *= 5;
projectile.aiStyle = 26;
aiType = ProjectileID.BabySkeletronHead;
}
public override void AI()
{
Player player = Main.player[projectile.owner];
CalamityPlayer modPlayer = player.Calamity();
if (!player.active)
{
projectile.active = false;
return;
}
if (player.dead)
{
modPlayer.ladShark = false;
}
if (modPlayer.ladShark)
{
projectile.timeLeft = 2;
}
projectile.rotation += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.01f * (float)projectile.direction;
//occasionally burst in hearts
if (Main.rand.NextBool(10000))
{
if (projectile.owner == Main.myPlayer)
{
int heartCount = Main.rand.Next(20, 31);
for (int i = 0; i < heartCount; i++)
{
Vector2 velocity = new Vector2((float)Main.rand.Next(-10, 11), (float)Main.rand.Next(-10, 11));
velocity.Normalize();
velocity.X *= 0.66f;
int heart = Gore.NewGore(projectile.Center, velocity * Main.rand.NextFloat(3f, 5f) * 0.33f, 331, Main.rand.NextFloat(40f, 120f) * 0.01f);
Main.gore[heart].sticky = false;
Main.gore[heart].velocity *= 5f;
}
Main.PlaySound(29, (int)projectile.position.X, (int)projectile.position.Y, 15); //mouse squeak sound
float radius = 240f; // 15 blocks
for (int j = 0; j < Main.maxNPCs; j++)
{
NPC npc = Main.npc[j];
if (npc.active && !npc.dontTakeDamage && Vector2.Distance(projectile.Center, npc.Center) <= radius)
{
if (npc.Calamity().ladHearts <= 0)
npc.Calamity().ladHearts = CalamityUtils.SecondsToFrames(9f);
}
}
for (int k = 0; k < Main.maxPlayers; k++)
{
Player players = Main.player[k];
if (!players.dead && Vector2.Distance(projectile.Center, players.Center) <= radius)
{
if (players.Calamity().ladHearts <= 0)
players.Calamity().ladHearts = CalamityUtils.SecondsToFrames(9f);
}
}
}
}
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 394 B

+160
View File
@@ -0,0 +1,160 @@
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Rogue
{
public class CircletMark : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Mark");
}
public override void SetDefaults()
{
projectile.width = 14;
projectile.height = 14;
projectile.friendly = true;
projectile.tileCollide = false;
projectile.timeLeft = 900;
projectile.ignoreWater = true;
projectile.alpha = 255;
projectile.Calamity().rogue = true;
projectile.penetrate = -1;
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = 10;
}
public override void AI()
{
Color newColor3 = new Color(255, 255, 255);
if (projectile.soundDelay == 0)
{
projectile.soundDelay = -1;
Main.PlaySound(2, projectile.Center, 60);
}
if (projectile.localAI[1] < 30f)
{
for (int num1134 = 0; num1134 < 1; num1134++)
{
float value79 = -0.5f;
float value80 = 0.9f;
float amount4 = Main.rand.NextFloat();
Vector2 value81 = new Vector2(MathHelper.Lerp(0.1f, 1f, Main.rand.NextFloat()), MathHelper.Lerp(value79, value80, amount4));
value81.X *= MathHelper.Lerp(2.2f, 0.6f, amount4);
value81.X *= -1f;
Vector2 value82 = new Vector2(2f, 10f);
Vector2 position4 = projectile.Center + new Vector2(60f, 200f) * value81 * 0.5f + value82;
Dust dust34 = Main.dust[Dust.NewDust(position4, 0, 0, 269, 0f, 0f, 0, default, 0.5f)];
dust34.position = position4;
dust34.customData = projectile.Center + value82;
dust34.fadeIn = 1f;
dust34.scale = 0.3f;
if (value81.X > -1.2f)
{
dust34.velocity.X = 1f + Main.rand.NextFloat();
}
dust34.velocity.Y = Main.rand.NextFloat() * -0.5f - 1f;
}
}
if (projectile.localAI[0] == 0f)
{
projectile.localAI[0] = 0.8f;
projectile.direction = 1;
Point point9 = projectile.Center.ToTileCoordinates();
projectile.Center = new Vector2((float)(point9.X * 16 + 8), (float)(point9.Y * 16 + 8));
}
projectile.rotation = projectile.localAI[1] / 40f * 6.28318548f * (float)projectile.direction;
if (projectile.localAI[1] < 33f)
{
if (projectile.alpha > 0)
{
projectile.alpha -= 8;
}
if (projectile.alpha < 0)
{
projectile.alpha = 0;
}
}
if (projectile.localAI[1] > 103f)
{
if (projectile.alpha < 255)
{
projectile.alpha += 16;
}
if (projectile.alpha > 255)
{
projectile.alpha = 255;
}
}
if (projectile.alpha == 0)
{
Lighting.AddLight(projectile.Center, newColor3.ToVector3() * 0.5f);
}
for (int num1135 = 0; num1135 < 2; num1135++)
{
if (Main.rand.NextBool(10))
{
Vector2 value83 = Vector2.UnitY.RotatedBy((double)((float)num1135 * 3.14159274f), default).RotatedBy((double)projectile.rotation, default);
Dust dust35 = Main.dust[Dust.NewDust(projectile.Center, 0, 0, 269, 0f, 0f, 225, newColor3, 1f)];
dust35.noGravity = true;
dust35.noLight = true;
dust35.scale = projectile.Opacity * projectile.localAI[0];
dust35.position = projectile.Center;
dust35.velocity = value83 * 2.5f;
}
}
for (int num1136 = 0; num1136 < 2; num1136++)
{
if (Main.rand.NextBool(10))
{
Vector2 value84 = Vector2.UnitY.RotatedBy((double)((float)num1136 * 3.14159274f), default);
Dust dust36 = Main.dust[Dust.NewDust(projectile.Center, 0, 0, 269, 0f, 0f, 225, newColor3, 1.5f)];
dust36.noGravity = true;
dust36.noLight = true;
dust36.scale = projectile.Opacity * projectile.localAI[0];
dust36.position = projectile.Center;
dust36.velocity = value84 * 2.5f;
}
}
if (projectile.localAI[1] < 33f || projectile.localAI[1] > 87f)
{
projectile.scale = projectile.Opacity / 2f * projectile.localAI[0];
}
projectile.velocity = Vector2.Zero;
projectile.localAI[1] += 1f;
if (projectile.localAI[1] == 60f && projectile.owner == Main.myPlayer)
{
Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType<CircletTornado>(), projectile.damage, 2f, projectile.owner, 0f, 0f);
}
if (projectile.localAI[1] >= 120f)
{
projectile.Kill();
return;
}
}
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
Color color25 = Lighting.GetColor((int)((double)projectile.position.X + (double)projectile.width * 0.5) / 16, (int)(((double)projectile.position.Y + (double)projectile.height * 0.5) / 16.0));
SpriteEffects spriteEffects = SpriteEffects.None;
if (projectile.spriteDirection == -1)
{
spriteEffects = SpriteEffects.FlipHorizontally;
}
Vector2 vector38 = projectile.position + new Vector2((float)projectile.width, (float)projectile.height) / 2f + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition;
Texture2D texture2D27 = Main.projectileTexture[projectile.type];
Rectangle rectangle11 = texture2D27.Frame(1, Main.projFrames[projectile.type], 0, projectile.frame);
Color alpha5 = projectile.GetAlpha(color25);
Vector2 origin7 = rectangle11.Size() / 2f;
Color color47 = Main.hslToRgb(0.25f, 1f, 1f).MultiplyRGBA(new Color(255, 255, 255, 0));
Main.spriteBatch.Draw(texture2D27, vector38, new Microsoft.Xna.Framework.Rectangle?(rectangle11), color47, 0f, origin7, new Vector2(1f, 5f) * projectile.scale * 2f, spriteEffects, 0f);
Main.spriteBatch.Draw(texture2D27, vector38, new Microsoft.Xna.Framework.Rectangle?(rectangle11), alpha5, projectile.rotation, origin7, projectile.scale, spriteEffects, 0f);
Main.spriteBatch.Draw(texture2D27, vector38, new Microsoft.Xna.Framework.Rectangle?(rectangle11), alpha5, 0f, origin7, new Vector2(1f, 8f) * projectile.scale, spriteEffects, 0f);
return false;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

+182
View File
@@ -0,0 +1,182 @@
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Rogue
{
public class CircletTornado : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Tornado");
}
public override void SetDefaults()
{
projectile.width = 10;
projectile.height = 10;
projectile.friendly = true;
projectile.tileCollide = false;
projectile.Calamity().rogue = true;
projectile.penetrate = -1;
projectile.timeLeft = 1200;
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = 20;
}
public override void AI()
{
//only 1 tornado can exist at a time
projectile.localAI[1] += 1f;
if (projectile.localAI[1] >= 10f)
{
projectile.localAI[1] = 0f;
int projCount = 0;
int oldestTornado = 0;
float tornadoAge = 0f;
int projType = projectile.type;
for (int projIndex = 0; projIndex < Main.maxProjectiles; projIndex++)
{
Projectile proj = Main.projectile[projIndex];
if (proj.active && proj.owner == projectile.owner && proj.type == projType && proj.ai[0] < 900f)
{
projCount++;
if (proj.ai[0] > tornadoAge)
{
oldestTornado = projIndex;
tornadoAge = proj.ai[0];
}
}
}
if (projCount > 1)
{
Main.projectile[oldestTornado].netUpdate = true;
Main.projectile[oldestTornado].ai[0] = 36000f;
return;
}
}
float lifeSpan = 900f;
if (projectile.soundDelay == 0)
{
projectile.soundDelay = -1;
Main.PlaySound(2, projectile.Center, 122);
}
projectile.ai[0] += 1f;
if (projectile.ai[0] >= lifeSpan)
{
projectile.Kill();
}
if (projectile.localAI[0] >= 30f)
{
projectile.damage = 0;
if (projectile.ai[0] < lifeSpan - 120f)
{
float num1126 = projectile.ai[0] % 60f;
projectile.ai[0] = lifeSpan - 120f + num1126;
projectile.netUpdate = true;
}
}
float num1127 = 15f;
float num1128 = 15f;
Point point8 = projectile.Center.ToTileCoordinates();
int num1129;
int num1130;
Collision.ExpandVertically(point8.X, point8.Y, out num1129, out num1130, (int)num1127, (int)num1128);
num1129++;
num1130--;
Vector2 value72 = new Vector2((float)point8.X, (float)num1129) * 16f + new Vector2(8f);
Vector2 value73 = new Vector2((float)point8.X, (float)num1130) * 16f + new Vector2(8f);
Vector2 vector146 = Vector2.Lerp(value72, value73, 0.5f);
Vector2 value74 = new Vector2(0f, value73.Y - value72.Y);
value74.X = value74.Y * 0.2f;
projectile.width = (int)(value74.X * 0.65f);
projectile.height = (int)value74.Y;
projectile.Center = vector146;
if (projectile.owner == Main.myPlayer)
{
bool flag74 = false;
Vector2 center16 = Main.player[projectile.owner].Center;
Vector2 top = Main.player[projectile.owner].Top;
for (float num1131 = 0f; num1131 < 1f; num1131 += 0.05f)
{
Vector2 position2 = Vector2.Lerp(value72, value73, num1131);
if (Collision.CanHitLine(position2, 0, 0, center16, 0, 0) || Collision.CanHitLine(position2, 0, 0, top, 0, 0))
{
flag74 = true;
break;
}
}
if (!flag74 && projectile.ai[0] < lifeSpan - 120f)
{
float num1132 = projectile.ai[0] % 60f;
projectile.ai[0] = lifeSpan - 120f + num1132;
projectile.netUpdate = true;
}
}
if (projectile.ai[0] < lifeSpan - 120f)
{
return;
}
}
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
float num226 = 600f;
float num227 = 15f;
float num228 = 15f;
float num229 = projectile.ai[0];
float scale5 = MathHelper.Clamp(num229 / 30f, 0f, 1f);
if (num229 > num226 - 60f)
{
scale5 = MathHelper.Lerp(1f, 0f, (num229 - (num226 - 60f)) / 60f);
}
Point point5 = projectile.Center.ToTileCoordinates();
int num230;
int num231;
Collision.ExpandVertically(point5.X, point5.Y, out num230, out num231, (int)num227, (int)num228);
num230++;
num231--;
float num232 = 0.2f;
Vector2 value32 = new Vector2((float)point5.X, (float)num230) * 16f + new Vector2(8f);
Vector2 value33 = new Vector2((float)point5.X, (float)num231) * 16f + new Vector2(8f);
Vector2.Lerp(value32, value33, 0.5f);
Vector2 vector33 = new Vector2(0f, value33.Y - value32.Y);
vector33.X = vector33.Y * num232;
new Vector2(value32.X - vector33.X / 2f, value32.Y);
Texture2D texture2D23 = Main.projectileTexture[projectile.type];
Rectangle rectangle9 = texture2D23.Frame(1, 1, 0, 0);
Vector2 origin3 = rectangle9.Size() / 2f;
float num233 = -0.06283186f * num229;
Vector2 spinningpoint2 = Vector2.UnitY.RotatedBy((double)(num229 * 0.1f), default);
float num234 = 0f;
float num235 = 5.1f;
Color value34 = new Color(225, 225, 100);
for (float num236 = (float)(int)value33.Y; num236 > (float)(int)value32.Y; num236 -= num235)
{
num234 += num235;
float num237 = num234 / vector33.Y;
float num238 = num234 * 6.28318548f / -20f;
float num239 = num237 - 0.15f;
Vector2 vector34 = spinningpoint2.RotatedBy((double)num238, default);
Vector2 value35 = new Vector2(0f, num237 + 1f);
value35.X = value35.Y * num232;
Color color39 = Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.Transparent, value34, num237 * 2f);
if (num237 > 0.5f)
{
color39 = Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.Transparent, value34, 2f - num237 * 2f);
}
color39.A = (byte)((float)color39.A * 0.5f);
color39 *= scale5;
vector34 *= value35 * 100f;
vector34.Y = 0f;
vector34.X = 0f;
vector34 += new Vector2(value33.X, num236) - Main.screenPosition;
Main.spriteBatch.Draw(texture2D23, vector34, new Microsoft.Xna.Framework.Rectangle?(rectangle9), color39, num233 + num238, origin3, 1f + num239, SpriteEffects.None, 0f);
}
return false;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 813 B

+188
View File
@@ -0,0 +1,188 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Summon
{
public class ForbiddenCircletEater : ModProjectile
{
private int bounce = 3;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Circlet Eater");
Main.projFrames[projectile.type] = 4;
}
public override void SetDefaults()
{
projectile.width = 16;
projectile.height = 16;
projectile.friendly = true;
projectile.alpha = 255;
projectile.penetrate = 1;
projectile.timeLeft = 300;
projectile.minion = true;
projectile.extraUpdates = 3;
}
public override void AI()
{
Player player = Main.player[projectile.owner];
if (projectile.alpha > 0)
{
projectile.alpha -= 50;
}
else
{
projectile.extraUpdates = 0;
}
if (projectile.alpha < 0)
{
projectile.alpha = 0;
}
projectile.frameCounter++;
if (projectile.frameCounter >= 6)
{
projectile.frame++;
projectile.frameCounter = 0;
}
if (projectile.frame >= 4)
{
projectile.frame = 0;
}
for (int num369 = 0; num369 < 1; num369++)
{
int dustType = 159;
float num370 = projectile.velocity.X / 3f * (float)num369;
float num371 = projectile.velocity.Y / 3f * (float)num369;
int num372 = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 0, default, 1f);
Dust dust = Main.dust[num372];
dust.position.X = projectile.Center.X - num370;
dust.position.Y = projectile.Center.Y - num371;
dust.velocity *= 0f;
dust.scale = 0.5f;
}
projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + MathHelper.PiOver2;
float num373 = projectile.position.X;
float num374 = projectile.position.Y;
float num375 = 100000f;
bool flag10 = false;
projectile.ai[0] += 1f;
if (projectile.ai[0] > 30f)
{
projectile.ai[0] = 30f;
if (player.HasMinionAttackTargetNPC)
{
NPC npc = Main.npc[player.MinionAttackTargetNPC];
if (npc.CanBeChasedBy(projectile, false))
{
float num377 = npc.position.X + (float)(npc.width / 2);
float num378 = npc.position.Y + (float)(npc.height / 2);
float num379 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num377) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num378);
if (num379 < 640f && num379 < num375 && Collision.CanHit(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height))
{
num375 = num379;
num373 = num377;
num374 = num378;
flag10 = true;
}
}
}
else
{
for (int num376 = 0; num376 < Main.maxNPCs; num376++)
{
NPC npc = Main.npc[num376];
if (npc.CanBeChasedBy(projectile, false))
{
float num377 = npc.position.X + (float)(npc.width / 2);
float num378 = npc.position.Y + (float)(npc.height / 2);
float num379 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num377) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num378);
if (num379 < 640f && num379 < num375 && Collision.CanHit(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height))
{
num375 = num379;
num373 = num377;
num374 = num378;
flag10 = true;
}
}
}
}
}
if (!flag10)
{
num373 = projectile.position.X + (float)(projectile.width / 2) + projectile.velocity.X * 100f;
num374 = projectile.position.Y + (float)(projectile.height / 2) + projectile.velocity.Y * 100f;
}
float num380 = 10f;
float num381 = 0.16f;
Vector2 vector30 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
float num382 = num373 - vector30.X;
float num383 = num374 - vector30.Y;
float num384 = (float)Math.Sqrt((double)(num382 * num382 + num383 * num383));
num384 = num380 / num384;
num382 *= num384;
num383 *= num384;
if (projectile.velocity.X < num382)
{
projectile.velocity.X = projectile.velocity.X + num381;
if (projectile.velocity.X < 0f && num382 > 0f)
{
projectile.velocity.X = projectile.velocity.X + num381 * 2f;
}
}
else if (projectile.velocity.X > num382)
{
projectile.velocity.X = projectile.velocity.X - num381;
if (projectile.velocity.X > 0f && num382 < 0f)
{
projectile.velocity.X = projectile.velocity.X - num381 * 2f;
}
}
if (projectile.velocity.Y < num383)
{
projectile.velocity.Y = projectile.velocity.Y + num381;
if (projectile.velocity.Y < 0f && num383 > 0f)
{
projectile.velocity.Y = projectile.velocity.Y + num381 * 2f;
}
}
else if (projectile.velocity.Y > num383)
{
projectile.velocity.Y = projectile.velocity.Y - num381;
if (projectile.velocity.Y > 0f && num383 < 0f)
{
projectile.velocity.Y = projectile.velocity.Y - num381 * 2f;
}
}
}
public override bool OnTileCollide(Vector2 oldVelocity)
{
bounce--;
if (bounce <= 0)
{
projectile.Kill();
}
else
{
if (projectile.velocity.X != oldVelocity.X)
{
projectile.velocity.X = -oldVelocity.X;
}
if (projectile.velocity.Y != oldVelocity.Y)
{
projectile.velocity.Y = -oldVelocity.Y;
}
}
return false;
}
public override bool CanDamage()
{
return projectile.ai[0] >= 30f;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

+2
View File
@@ -37,6 +37,8 @@ namespace CalamityMod.Projectiles.Typeless
public override void AI()
{
projectile.friendly = true;
projectile.hostile = false;
bool flag64 = projectile.type == ModContent.ProjectileType<GladiatorSword>();
Player player = Main.player[projectile.owner];
CalamityPlayer modPlayer = player.Calamity();
+2
View File
@@ -37,6 +37,8 @@ namespace CalamityMod.Projectiles.Typeless
public override void AI()
{
projectile.friendly = true;
projectile.hostile = false;
bool flag64 = projectile.type == ModContent.ProjectileType<GladiatorSword2>();
Player player = Main.player[projectile.owner];
CalamityPlayer modPlayer = player.Calamity();