Resolved a merge conflict
No files matched your search
@@ -1,13 +1,14 @@
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.CalPlayer;
|
||||
|
||||
namespace CalamityMod.Buffs.DoTDebuffs
|
||||
{
|
||||
public class AbyssalFlames : ModBuff
|
||||
{
|
||||
public override void SetDefaults()
|
||||
public static int DefenseReduction = 10;
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Abyssal Flames");
|
||||
Description.SetDefault("Your soul is being consumed");
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.CalPlayer;
|
||||
|
||||
namespace CalamityMod.Buffs.DoTDebuffs
|
||||
{
|
||||
public class AstralInfectionDebuff : ModBuff
|
||||
{
|
||||
public override void SetDefaults()
|
||||
public static int DefenseReduction = 8;
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Astral Infection");
|
||||
Description.SetDefault("Your flesh is melting off");
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.CalPlayer;
|
||||
|
||||
namespace CalamityMod.Buffs.DoTDebuffs
|
||||
{
|
||||
public class GodSlayerInferno : ModBuff
|
||||
{
|
||||
public override void SetDefaults()
|
||||
public static int DefenseReduction = 20;
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("God Slayer Inferno");
|
||||
Description.SetDefault("Your flesh is burning off");
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.CalPlayer;
|
||||
|
||||
namespace CalamityMod.Buffs.DoTDebuffs
|
||||
{
|
||||
public class Plague : ModBuff
|
||||
{
|
||||
public override void SetDefaults()
|
||||
public static int DefenseReduction = 4;
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Plague");
|
||||
Description.SetDefault("Rotting from the inside");
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.CalPlayer;
|
||||
|
||||
namespace CalamityMod.Buffs.StatDebuffs
|
||||
{
|
||||
public class AbyssalMirrorCooldown : ModBuff
|
||||
{
|
||||
public override void SetDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Abyssal Evade Cooldown");
|
||||
Description.SetDefault("Your Abyssal Mirror's dodge is recharging");
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
longerExpertDebuff = false;
|
||||
canBeCleared = false;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
player.GetModPlayer<CalamityPlayer>(mod).abyssalMirrorCooldown = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 3.3 KiB |
@@ -0,0 +1,25 @@
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.CalPlayer;
|
||||
|
||||
namespace CalamityMod.Buffs.StatDebuffs
|
||||
{
|
||||
public class EclipseMirrorCooldown : ModBuff
|
||||
{
|
||||
public override void SetDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Eclipse Evade Cooldown");
|
||||
Description.SetDefault("Your Eclipse Mirror's dodge is recharging");
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
longerExpertDebuff = false;
|
||||
canBeCleared = false;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
player.GetModPlayer<CalamityPlayer>(mod).eclipseMirrorCooldown = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 3.1 KiB |
@@ -0,0 +1,25 @@
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.CalPlayer;
|
||||
|
||||
namespace CalamityMod.Buffs.StatDebuffs
|
||||
{
|
||||
public class InkBombCooldown : ModBuff
|
||||
{
|
||||
public override void SetDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Ink Bomb Cooldown");
|
||||
Description.SetDefault("Your Ink Bomb is recharging");
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
longerExpertDebuff = false;
|
||||
canBeCleared = false;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
player.GetModPlayer<CalamityPlayer>(mod).inkBombCooldown = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 517 B |
@@ -6,7 +6,9 @@ namespace CalamityMod.Buffs.StatDebuffs
|
||||
{
|
||||
public class WarCleave : ModBuff
|
||||
{
|
||||
public override void SetDefaults()
|
||||
public static int DefenseReduction = 15;
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("War Cleave");
|
||||
Description.SetDefault("Defense and protection reduced");
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.CalPlayer;
|
||||
|
||||
namespace CalamityMod.Buffs.StatDebuffs
|
||||
{
|
||||
public class WhisperingDeath : ModBuff
|
||||
{
|
||||
public override void SetDefaults()
|
||||
public static int DefenseReduction = 50;
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Whispering Death");
|
||||
Description.SetDefault("Death approaches; defense, attack power, and life regen reduced");
|
||||
|
||||
@@ -85,7 +85,8 @@ namespace CalamityMod.CalPlayer
|
||||
public float stealthGenStandstill = 1f;
|
||||
public float stealthGenMoving = 0f;
|
||||
public float stealthGenMultiplier = 1f;
|
||||
private bool stealthStrikeThisFrame = false;
|
||||
private float stealthGenAcceleration = 1f;
|
||||
private bool stealthStrikeThisFrame = false;
|
||||
public bool stealthStrikeHalfCost = false;
|
||||
public bool stealthStrikeAlwaysCrits = false;
|
||||
public bool wearingRogueArmor = false;
|
||||
@@ -296,11 +297,18 @@ namespace CalamityMod.CalPlayer
|
||||
public bool brimstoneWaifu = false;
|
||||
public bool sirenWaifu = false;
|
||||
public bool fungalClump = false;
|
||||
public bool darkGodSheath = false;
|
||||
public bool inkBomb = false;
|
||||
public bool inkBombCooldown = false;
|
||||
public bool abyssalMirror = false;
|
||||
public bool abyssalMirrorCooldown = false;
|
||||
public bool eclipseMirror = false;
|
||||
public bool eclipseMirrorCooldown = false;
|
||||
public bool oldDie = false;
|
||||
|
||||
// Armor Set
|
||||
public bool victideSet = false;
|
||||
public bool aeroSet = false;
|
||||
// Armor Set
|
||||
public bool victideSet = false;
|
||||
public bool aeroSet = false;
|
||||
public bool statigelSet = false;
|
||||
public bool tarraSet = false;
|
||||
public bool tarraMelee = false;
|
||||
@@ -997,7 +1005,15 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
weakPetrification = false;
|
||||
|
||||
shadowflame = false;
|
||||
inkBomb = false;
|
||||
inkBombCooldown = false;
|
||||
darkGodSheath = false;
|
||||
abyssalMirror = false;
|
||||
abyssalMirrorCooldown = false;
|
||||
eclipseMirror = false;
|
||||
eclipseMirrorCooldown = false;
|
||||
|
||||
shadowflame = false;
|
||||
wDeath = false;
|
||||
lethalLavaBurn = false;
|
||||
aCrunch = false;
|
||||
@@ -1217,11 +1233,14 @@ namespace CalamityMod.CalPlayer
|
||||
abyssalDivingSuitCooldown = false;
|
||||
abyssalDivingSuitPlateHits = 0;
|
||||
sirenIceCooldown = false;
|
||||
#endregion
|
||||
inkBombCooldown = false;
|
||||
abyssalMirrorCooldown = false;
|
||||
eclipseMirrorCooldown = false;
|
||||
#endregion
|
||||
|
||||
#region Rogue
|
||||
#region Rogue
|
||||
// Stealth
|
||||
rogueStealth = 0f;
|
||||
rogueStealth = 0f;
|
||||
rogueStealthMax = 0f;
|
||||
|
||||
throwingDamage = 1f;
|
||||
@@ -4629,10 +4648,48 @@ namespace CalamityMod.CalPlayer
|
||||
if (player.wingTimeMax < 50000)
|
||||
player.wingTimeMax = 50000;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
|
||||
public override void PostUpdateRunSpeeds()
|
||||
#region Rogue Mirrors
|
||||
Rectangle rectangle = new Rectangle((int)((double)player.position.X + (double)player.velocity.X * 0.5 - 4.0), (int)((double)player.position.Y + (double)player.velocity.Y * 0.5 - 4.0), player.width + 8, player.height + 8);
|
||||
for (int i = 0; i < 200; i++)
|
||||
{
|
||||
if ((Main.npc[i].active && !Main.npc[i].dontTakeDamage && !Main.npc[i].friendly && !Main.npc[i].townNPC && Main.npc[i].immune[player.whoAmI] <= 0 && Main.npc[i].damage > 0))
|
||||
{
|
||||
NPC nPC = Main.npc[i];
|
||||
Rectangle rect = nPC.getRect();
|
||||
if (rectangle.Intersects(rect) && (nPC.noTileCollide || player.CanHit(nPC)))
|
||||
{
|
||||
if (Main.rand.Next(0, 10) == 0)
|
||||
{
|
||||
AbyssMirrorEvade();
|
||||
EclipseMirrorEvade();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < 1000; i++)
|
||||
{
|
||||
if ((Main.projectile[i].active && !Main.projectile[i].friendly && Main.projectile[i].hostile && Main.projectile[i].damage > 0))
|
||||
{
|
||||
Projectile proj = Main.projectile[i];
|
||||
Rectangle rect = proj.getRect();
|
||||
if (rectangle.Intersects(rect))
|
||||
{
|
||||
if (Main.rand.Next(0, 10) == 0)
|
||||
{
|
||||
AbyssMirrorEvade();
|
||||
EclipseMirrorEvade();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
public override void PostUpdateRunSpeeds()
|
||||
{
|
||||
#region SpeedBoosts
|
||||
float runAccMult = 1f +
|
||||
@@ -4710,12 +4767,75 @@ namespace CalamityMod.CalPlayer
|
||||
player.accRunSpeed = player.maxRunSpeed;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
}
|
||||
|
||||
#region Pre Kill
|
||||
public override bool PreKill(double damage, int hitDirection, bool pvp, ref bool playSound, ref bool genGore, ref PlayerDeathReason damageSource)
|
||||
#region Rogue Mirrors
|
||||
private void AbyssMirrorEvade()
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer && abyssalMirror && !abyssalMirrorCooldown)
|
||||
{
|
||||
player.AddBuff(mod.BuffType("AbyssalMirrorCooldown"), 1200);
|
||||
player.immune = true;
|
||||
player.immuneTime = player.longInvince ? 100 : 60;
|
||||
player.noKnockback = true;
|
||||
rogueStealth += 0.5f;
|
||||
|
||||
for (int k = 0; k < player.hurtCooldowns.Length; k++)
|
||||
{
|
||||
player.hurtCooldowns[k] = player.immuneTime;
|
||||
}
|
||||
|
||||
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/SilvaActivation"), (int)Main.player[Main.myPlayer].position.X, (int)Main.player[Main.myPlayer].position.Y);
|
||||
|
||||
for (int i = 0; i < 50; i++)
|
||||
{
|
||||
//Get which projectile to use
|
||||
int projType = Main.rand.Next(0, 3);
|
||||
int lumenylType;
|
||||
switch (projType)
|
||||
{
|
||||
case 0:
|
||||
lumenylType = mod.ProjectileType("AbyssalMirrorProjectile1");
|
||||
break;
|
||||
case 1:
|
||||
lumenylType = mod.ProjectileType("AbyssalMirrorProjectile2");
|
||||
break;
|
||||
default:
|
||||
lumenylType = mod.ProjectileType("AbyssalMirrorProjectile3");
|
||||
break;
|
||||
}
|
||||
int lumenyl = Projectile.NewProjectile(player.Center.X, player.Center.Y, Main.rand.NextFloat(-2f, 2f), Main.rand.NextFloat(-2f, 2f), lumenylType, 55, 0, player.whoAmI);
|
||||
Main.projectile[lumenyl].rotation = Main.rand.NextFloat(0, 360);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void EclipseMirrorEvade()
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer && eclipseMirror && !eclipseMirrorCooldown)
|
||||
{
|
||||
player.AddBuff(mod.BuffType("EclipseMirrorCooldown"), 1200);
|
||||
player.immune = true;
|
||||
player.immuneTime = player.longInvince ? 100 : 60;
|
||||
player.noKnockback = true;
|
||||
rogueStealth = rogueStealthMax;
|
||||
|
||||
for (int k = 0; k < player.hurtCooldowns.Length; k++)
|
||||
{
|
||||
player.hurtCooldowns[k] = player.immuneTime;
|
||||
}
|
||||
|
||||
Main.PlaySound(2, (int)Main.player[Main.myPlayer].position.X, (int)Main.player[Main.myPlayer].position.Y, 68);
|
||||
int eclipseBurst = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, mod.ProjectileType("EclipseMirrorBurst"), 8000, 0, player.whoAmI);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region Pre Kill
|
||||
public override bool PreKill(double damage, int hitDirection, bool pvp, ref bool playSound, ref bool genGore, ref PlayerDeathReason damageSource)
|
||||
{
|
||||
if (invincible && player.inventory[player.selectedItem].type != mod.ItemType("ColdheartIcicle"))
|
||||
{
|
||||
@@ -7333,8 +7453,21 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ataxiaBlaze && Main.rand.NextBool(5))
|
||||
}
|
||||
if (inkBomb)
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer && !inkBombCooldown)
|
||||
{
|
||||
player.AddBuff(mod.BuffType("InkBombCooldown"), 1200);
|
||||
rogueStealth += 0.5f;
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
Main.PlaySound(2, (int)Main.player[Main.myPlayer].position.X, (int)Main.player[Main.myPlayer].position.Y, 61);
|
||||
int inkBomb = Projectile.NewProjectile(player.Center.X, player.Center.Y, Main.rand.NextFloat(-3f, 3f), Main.rand.NextFloat(-0f, -4f), mod.ProjectileType("InkBombProjectile"), 0, 0, player.whoAmI);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ataxiaBlaze && Main.rand.NextBool(5))
|
||||
{
|
||||
if (damage > 0)
|
||||
{
|
||||
@@ -9301,22 +9434,45 @@ namespace CalamityMod.CalPlayer
|
||||
stealthGenMoving += 0.2f;
|
||||
else
|
||||
stealthGenMoving += 0.1f;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Other code which affects stealth generation goes here.
|
||||
// Increase stealthGenStandstill (default 1.0) to increase basic "stand still" stealth generation.
|
||||
// Incrase stealthGenMoving (default 0.0) to increase stealth generation while moving.
|
||||
// Increase stealthGenMultiplier (default 1.0) to provide a global % boost to all stealth generation.
|
||||
//
|
||||
bool standstill = Math.Abs(player.velocity.X) < 0.1f && Math.Abs(player.velocity.Y) < 0.1f && !player.mount.Active;
|
||||
|
||||
// You get 100% stealth regen while standing still and not on a mount. Otherwise, you get your stealth regeneration while moving.
|
||||
bool standstill = Math.Abs(player.velocity.X) < 0.1f && Math.Abs(player.velocity.Y) < 0.1f && !player.mount.Active;
|
||||
if (standstill)
|
||||
return stealthGenStandstill * stealthGenMultiplier;
|
||||
else
|
||||
return stealthGenMoving * stealthGenMultiplier;
|
||||
}
|
||||
// Stealth gen acceleration
|
||||
float stealthScaleCap = eclipseMirror ? 40f : 25f;
|
||||
|
||||
if (standstill && (eclipseMirror || darkGodSheath))
|
||||
{
|
||||
if (eclipseMirror)
|
||||
stealthGenAcceleration = stealthGenAcceleration < stealthScaleCap ? stealthGenAcceleration * 1.2f : stealthScaleCap;
|
||||
if (darkGodSheath)
|
||||
stealthGenAcceleration = stealthGenAcceleration < stealthScaleCap ? stealthGenAcceleration + 0.15f : stealthScaleCap;
|
||||
}
|
||||
else
|
||||
{
|
||||
stealthGenAcceleration = 1f;
|
||||
}
|
||||
|
||||
//
|
||||
// Other code which affects stealth generation goes here.
|
||||
// Increase stealthGenStandstill (default 1.0) to increase basic "stand still" stealth generation.
|
||||
// Incrase stealthGenMoving (default 0.0) to increase stealth generation while moving.
|
||||
// Increase stealthGenMultiplier (default 1.0) to provide a global % boost to all stealth generation.
|
||||
//
|
||||
|
||||
// You get 100% stealth regen while standing still and not on a mount. Otherwise, you get your stealth regeneration while moving.
|
||||
if (standstill)
|
||||
{
|
||||
if (eclipseMirror || darkGodSheath)
|
||||
return stealthGenStandstill * stealthGenMultiplier * stealthGenAcceleration;
|
||||
else
|
||||
return stealthGenStandstill * stealthGenMultiplier;
|
||||
}
|
||||
else
|
||||
{
|
||||
return stealthGenMoving * stealthGenMultiplier;
|
||||
}
|
||||
}
|
||||
|
||||
public bool StealthStrikeAvailable()
|
||||
{
|
||||
@@ -10467,6 +10623,30 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
return meleeSpeedBonus;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Misc Stuff
|
||||
|
||||
/// <summary>
|
||||
/// Returns the range at which an abyss enemy can detect the player
|
||||
/// </summary>
|
||||
/// <param name="defaultRange">The default detection range</param>
|
||||
/// <param name="anechoicRange">The detection range set by the player having anechoic plating/coating</param>
|
||||
/// <returns></returns>
|
||||
public float GetAbyssAggro(float defaultRange, float anechoicRange)
|
||||
{
|
||||
/* ((Main.player[npc.target].GetCalamityPlayer().anechoicPlating ||
|
||||
Main.player[npc.target].GetCalamityPlayer().anechoicCoating) ? 200f : 600f) *
|
||||
(Main.player[npc.target].GetCalamityPlayer().fishAlert ? 3f : 1f) *
|
||||
(Main.player[npc.target].GetCalamityPlayer().abyssalMirror ? 0.7f : 1f) *
|
||||
(Main.player[npc.target].GetCalamityPlayer().eclipseMirror ? 0.3f : 1f) */
|
||||
float range = anechoicPlating || anechoicCoating ? anechoicRange : defaultRange;
|
||||
range *= fishAlert ? 3f : 1f;
|
||||
range *= abyssalMirror ? 0.65f : 1f;
|
||||
range *= eclipseMirror ? 0.3f : 1f;
|
||||
return range;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.CalPlayer;
|
||||
|
||||
namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
public class AbyssalMirror : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Abyssal Mirror");
|
||||
Tooltip.SetDefault("Light does not reach the depths of the ocean\n" +
|
||||
"Significantly reduces enemy aggression, even in the abyss\n" +
|
||||
"15% increased stealth regeneration while moving\n" +
|
||||
"Grants a slight chance to evade attacks, releasing a cloud of lumenyl fluid which damages and stuns nearby enemies\n" +
|
||||
"Evading an attack grants a lot of stealth\n" +
|
||||
"This evade has a 20s cooldown before it can occur again");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 20;
|
||||
item.height = 20;
|
||||
item.value = Item.buyPrice(0, 6, 0, 0);
|
||||
item.rare = 8;
|
||||
item.accessory = true;
|
||||
}
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
CalamityPlayer modPlayer = player.GetModPlayer<CalamityPlayer>(mod);
|
||||
modPlayer.stealthGenMoving += 0.15f;
|
||||
modPlayer.abyssalMirror = true;
|
||||
player.aggro -= 450;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(mod.GetItem("MirageMirror"));
|
||||
recipe.AddIngredient(mod.GetItem("InkBomb"));
|
||||
recipe.AddIngredient(ItemID.SpectreBar, 8);
|
||||
recipe.AddIngredient(ItemID.BlackBelt);
|
||||
recipe.AddIngredient(mod.GetItem("DepthCells"), 5);
|
||||
recipe.AddIngredient(mod.GetItem("Lumenite"), 5);
|
||||
recipe.AddTile(TileID.MythrilAnvil);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 869 B |
@@ -0,0 +1,52 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.CalPlayer;
|
||||
|
||||
namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
public class DarkGodsSheath : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Dark God's Sheath");
|
||||
Tooltip.SetDefault("+100 maximum stealth\n" +
|
||||
"Stealth regeneration rate increases while standing still\n" +
|
||||
"Stealth strikes have a 100% critical hit chance\n" +
|
||||
"Stealth strikes only expend 50% of your max stealth\n" +
|
||||
"6% increased rogue damage, and 6% increased rogue crit chance");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 20;
|
||||
item.height = 20;
|
||||
item.value = Item.buyPrice(0, 26, 0, 0);
|
||||
item.rare = 9;
|
||||
item.accessory = true;
|
||||
}
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
CalamityPlayer modPlayer = player.GetModPlayer<CalamityPlayer>(mod);
|
||||
modPlayer.stealthStrikeAlwaysCrits = true;
|
||||
modPlayer.stealthStrikeHalfCost = true;
|
||||
modPlayer.rogueStealthMax += 1;
|
||||
modPlayer.darkGodSheath = true;
|
||||
modPlayer.throwingCrit += 6;
|
||||
modPlayer.throwingDamage += 0.06f;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(mod.ItemType("SilencingSheath"));
|
||||
recipe.AddIngredient(mod.ItemType("RuinMedallion"));
|
||||
recipe.AddIngredient(mod.ItemType("MeldiateBar"), 5);
|
||||
recipe.AddIngredient(mod.ItemType("Stardust"), 25);
|
||||
recipe.AddTile(TileID.LunarCraftingStation);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
@@ -0,0 +1,60 @@
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.CalPlayer;
|
||||
|
||||
namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
public class EclipseMirror : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Eclipse Mirror");
|
||||
Tooltip.SetDefault("Its reflection shows naught but darkness\n" +
|
||||
"+100 maximum stealth\n" +
|
||||
"8% increased rogue damage, and 8% increased rogue crit chance\n" +
|
||||
"Vastly reduces enemy aggression, even in the abyss\n" +
|
||||
"20% increased stealth regeneration while moving\n" +
|
||||
"Stealth regeneration rate exponentially increases while standing still\n" +
|
||||
"Stealth strikes have a 100% critical hit chance\n" +
|
||||
"Stealth strikes only expend 50% of your max stealth\n" +
|
||||
"Grants a small chance to evade attacks in a blast of darksun light, which inflicts extreme damage in a wide area\n" +
|
||||
"Evading an attack grants full stealth\n" +
|
||||
"This evade has a 20s cooldown before it can occur again");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 20;
|
||||
item.height = 20;
|
||||
item.value = Item.buyPrice(0, 22, 0, 0);
|
||||
item.GetGlobalItem<CalamityGlobalItem>(mod).postMoonLordRarity = 15;
|
||||
item.accessory = true;
|
||||
}
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
CalamityPlayer modPlayer = player.GetModPlayer<CalamityPlayer>(mod);
|
||||
modPlayer.stealthGenMoving += 0.2f;
|
||||
modPlayer.rogueStealthMax += 1;
|
||||
modPlayer.eclipseMirror = true;
|
||||
modPlayer.stealthStrikeAlwaysCrits = true;
|
||||
modPlayer.stealthStrikeHalfCost = true;
|
||||
modPlayer.throwingCrit += 8;
|
||||
modPlayer.throwingDamage += 0.08f;
|
||||
player.aggro -= 700;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(mod.GetItem("AbyssalMirror"));
|
||||
recipe.AddIngredient(mod.GetItem("DarkGodsSheath"));
|
||||
recipe.AddIngredient(mod.GetItem("DarksunFragment"), 10);
|
||||
recipe.AddIngredient(mod.GetItem("NightmareFuel"), 5);
|
||||
recipe.AddIngredient(mod.GetItem("EndothermicEnergy"), 5);
|
||||
recipe.AddTile(mod.GetTile("DraedonsForge"));
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 786 B |
@@ -0,0 +1,36 @@
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.CalPlayer;
|
||||
|
||||
namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
public class InkBomb : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Ink Bomb");
|
||||
Tooltip.SetDefault("Throws several ink bombs when hit that explode in a confusing cloud of ink\n" +
|
||||
"Gain a lot of stealth when struck\n" +
|
||||
"This effect has a 20s cooldown before it can occur again");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 20;
|
||||
item.height = 20;
|
||||
item.value = Item.buyPrice(0, 3, 0, 0);
|
||||
item.rare = 3;
|
||||
item.accessory = true;
|
||||
}
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
CalamityPlayer modPlayer = player.GetModPlayer<CalamityPlayer>(mod);
|
||||
modPlayer.inkBomb = true;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 765 B |
@@ -0,0 +1,53 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.CalPlayer;
|
||||
|
||||
namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
public class MirageMirror : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Mirage Mirror");
|
||||
Tooltip.SetDefault("Bend light around you\n" +
|
||||
"Reduces enemy aggression outside of the abyss\n" +
|
||||
"10% increased stealth regeneration while moving");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 20;
|
||||
item.height = 20;
|
||||
item.value = Item.buyPrice(0, 2, 0, 0);
|
||||
item.rare = 2;
|
||||
item.accessory = true;
|
||||
}
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
CalamityPlayer modPlayer = player.GetModPlayer<CalamityPlayer>(mod);
|
||||
modPlayer.stealthGenMoving += 0.1f;
|
||||
player.aggro -= 200;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ItemID.MagicMirror);
|
||||
recipe.AddIngredient(ItemID.BlackLens);
|
||||
recipe.AddIngredient(ItemID.Bone, 50);
|
||||
recipe.AddTile(TileID.TinkerersWorkbench);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
|
||||
recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ItemID.IceMirror);
|
||||
recipe.AddIngredient(ItemID.BlackLens);
|
||||
recipe.AddIngredient(ItemID.Bone, 50);
|
||||
recipe.AddTile(TileID.TinkerersWorkbench);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 574 B |
@@ -0,0 +1,45 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.CalPlayer;
|
||||
|
||||
namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
public class RuinMedallion : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Ruin Medallion");
|
||||
Tooltip.SetDefault("Stealth strikes only expend 50% of your max stealth\n" +
|
||||
"6% increased rogue damage, and 6% increased rogue crit chance");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 20;
|
||||
item.height = 20;
|
||||
item.value = Item.buyPrice(0, 13, 0, 0);
|
||||
item.rare = 6;
|
||||
item.accessory = true;
|
||||
}
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
CalamityPlayer modPlayer = player.GetModPlayer<CalamityPlayer>(mod);
|
||||
modPlayer.stealthStrikeHalfCost = true;
|
||||
modPlayer.throwingCrit += 6;
|
||||
modPlayer.throwingDamage += 0.06f;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(mod.ItemType("CoinofDeceit"));
|
||||
recipe.AddIngredient(mod.ItemType("UnholyCore"), 4);
|
||||
recipe.AddIngredient(mod.ItemType("EssenceofChaos"), 2);
|
||||
recipe.AddTile(TileID.MythrilAnvil);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 431 B |
@@ -0,0 +1,52 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.CalPlayer;
|
||||
|
||||
namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
public class SilencingSheath : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Silencing Sheath");
|
||||
Tooltip.SetDefault("+50 maximum stealth\n" +
|
||||
"10% increased stealth regeneration while standing still");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 20;
|
||||
item.height = 20;
|
||||
item.value = Item.buyPrice(0, 2, 0, 0);
|
||||
item.rare = 2;
|
||||
item.accessory = true;
|
||||
}
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
CalamityPlayer modPlayer = player.GetModPlayer<CalamityPlayer>(mod);
|
||||
modPlayer.rogueStealthMax += 0.5f;
|
||||
modPlayer.stealthGenStandstill += 0.1f;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ItemID.DemoniteBar, 8);
|
||||
recipe.AddIngredient(ItemID.Silk, 10);
|
||||
recipe.AddIngredient(ItemID.ShadowScale, 3);
|
||||
recipe.AddTile(TileID.TinkerersWorkbench);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
|
||||
recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ItemID.CrimtaneBar, 8);
|
||||
recipe.AddIngredient(ItemID.Silk, 10);
|
||||
recipe.AddIngredient(ItemID.TissueSample, 3);
|
||||
recipe.AddTile(TileID.TinkerersWorkbench);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 495 B |
@@ -44,4 +44,4 @@ namespace CalamityMod.Items.CalamityCustomThrowingDamage
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -53,7 +53,7 @@ namespace CalamityMod.Items.CalamityCustomThrowingDamage
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
|
||||
@@ -1805,7 +1805,7 @@ namespace CalamityMod.Items
|
||||
|
||||
if (item.type == ItemID.WormScarf)
|
||||
player.endurance -= 0.07f;
|
||||
|
||||
|
||||
if (item.type == ItemID.RoyalGel)
|
||||
modPlayer.royalGel = true;
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace CalamityMod.Items.Weapons.Astral
|
||||
item.shoot = mod.ProjectileType("AstralRound");
|
||||
item.useAmmo = 97;
|
||||
}
|
||||
|
||||
|
||||
public override Vector2? HoldoutOffset()
|
||||
{
|
||||
return new Vector2(-5, 0);
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace CalamityMod.Items.Weapons.Bumblebirb
|
||||
item.useAmmo = 97;
|
||||
item.GetGlobalItem<CalamityGlobalItem>(mod).postMoonLordRarity = 12;
|
||||
}
|
||||
|
||||
|
||||
public override Vector2? HoldoutOffset()
|
||||
{
|
||||
return new Vector2(-5, 0);
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace CalamityMod.Items.Weapons.Crabulon
|
||||
item.shootSpeed = 14f;
|
||||
item.useAmmo = 97;
|
||||
}
|
||||
|
||||
|
||||
public override Vector2? HoldoutOffset()
|
||||
{
|
||||
return new Vector2(-5, 0);
|
||||
|
||||
@@ -40,19 +40,19 @@ namespace CalamityMod.Items.Weapons
|
||||
item.shootSpeed = 14.6f;
|
||||
item.useAmmo = 23;
|
||||
}
|
||||
|
||||
|
||||
public override Vector2? HoldoutOffset()
|
||||
{
|
||||
return new Vector2(-15, 0);
|
||||
}
|
||||
|
||||
|
||||
public override bool ConsumeAmmo(Player player)
|
||||
{
|
||||
if (Main.rand.Next(0, 100) < 50)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
@@ -63,4 +63,4 @@ namespace CalamityMod.Items.Weapons
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -37,7 +37,7 @@ namespace CalamityMod.Items.Weapons.Perforators
|
||||
item.shootSpeed = 22f;
|
||||
item.useAmmo = 97;
|
||||
}
|
||||
|
||||
|
||||
public override Vector2? HoldoutOffset()
|
||||
{
|
||||
return new Vector2(-7, 0);
|
||||
|
||||
@@ -39,12 +39,12 @@ namespace CalamityMod.Items.Weapons
|
||||
item.useAmmo = 97;
|
||||
item.GetGlobalItem<CalamityGlobalItem>(mod).postMoonLordRarity = 14;
|
||||
}
|
||||
|
||||
|
||||
public override Vector2? HoldoutOffset()
|
||||
{
|
||||
return new Vector2(-10, 0);
|
||||
}
|
||||
|
||||
|
||||
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)
|
||||
{
|
||||
float SpeedX = speedX + (float)Main.rand.Next(-5, 6) * 0.05f;
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace CalamityMod.Items.Weapons
|
||||
item.shoot = mod.ProjectileType("SlagRound");
|
||||
item.useAmmo = 97;
|
||||
}
|
||||
|
||||
|
||||
public override Vector2? HoldoutOffset()
|
||||
{
|
||||
return new Vector2(-10, 0);
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace CalamityMod.Items.Weapons.SlimeGod
|
||||
item.shootSpeed = 5f;
|
||||
item.useAmmo = 97;
|
||||
}
|
||||
|
||||
|
||||
public override Vector2? HoldoutOffset()
|
||||
{
|
||||
return new Vector2(-5, 0);
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace CalamityMod.Items.Weapons.SlimeGod
|
||||
item.shoot = mod.ProjectileType("SlimeBolt");
|
||||
item.useAmmo = 23;
|
||||
}
|
||||
|
||||
|
||||
public override Vector2? HoldoutOffset()
|
||||
{
|
||||
return new Vector2(-4, 0);
|
||||
|
||||
@@ -36,19 +36,19 @@ namespace CalamityMod.Items.Weapons
|
||||
item.shootSpeed = 5f;
|
||||
item.useAmmo = 23;
|
||||
}
|
||||
|
||||
|
||||
public override Vector2? HoldoutOffset()
|
||||
{
|
||||
return new Vector2(-4, 0);
|
||||
}
|
||||
|
||||
|
||||
public override bool ConsumeAmmo(Player player)
|
||||
{
|
||||
if (Main.rand.Next(0, 100) < 20)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
@@ -60,4 +60,4 @@ namespace CalamityMod.Items.Weapons
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -62,10 +62,11 @@ namespace CalamityMod.NPCs.AbyssNPCs
|
||||
if (npc.ai[1] >= 60f)
|
||||
{
|
||||
npc.TargetClosest(true);
|
||||
if (npc.Center.Y + ((Main.player[npc.target].GetCalamityPlayer().anechoicPlating ||
|
||||
Main.player[npc.target].GetCalamityPlayer().anechoicCoating) ? 50f : 100f) > Main.player[npc.target].Center.Y &&
|
||||
Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height))
|
||||
{
|
||||
//if (npc.Center.Y + ((Main.player[npc.target].GetCalamityPlayer().anechoicPlating ||
|
||||
// Main.player[npc.target].GetCalamityPlayer().anechoicCoating) ? 50f : 100f) > Main.player[npc.target].Center.Y &&
|
||||
if (npc.Center.Y + Main.player[npc.target].GetCalamityPlayer().GetAbyssAggro(100f, 50f) > Main.player[npc.target].Center.Y &&
|
||||
Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height))
|
||||
{
|
||||
npc.ai[1] = 0f;
|
||||
npc.ai[0] = 1f;
|
||||
return;
|
||||
|
||||
@@ -321,10 +321,11 @@ namespace CalamityMod.NPCs.AbyssNPCs
|
||||
npc.TargetClosest(false);
|
||||
if ((Main.player[npc.target].wet && !Main.player[npc.target].dead &&
|
||||
Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height) &&
|
||||
(Main.player[npc.target].Center - npc.Center).Length() < ((Main.player[npc.target].GetCalamityPlayer().anechoicPlating ||
|
||||
Main.player[npc.target].GetCalamityPlayer().anechoicCoating) ? 150f : 300f) *
|
||||
(Main.player[npc.target].GetCalamityPlayer().fishAlert ? 3f : 1f)) ||
|
||||
npc.justHit)
|
||||
//(Main.player[npc.target].Center - npc.Center).Length() < ((Main.player[npc.target].GetCalamityPlayer().anechoicPlating ||
|
||||
//Main.player[npc.target].GetCalamityPlayer().anechoicCoating) ? 150f : 300f) *
|
||||
//(Main.player[npc.target].GetCalamityPlayer().fishAlert ? 3f : 1f)) ||
|
||||
(Main.player[npc.target].Center - npc.Center).Length() < Main.player[npc.target].GetCalamityPlayer().GetAbyssAggro(300f, 150f)) ||
|
||||
npc.justHit)
|
||||
{
|
||||
hasBeenHit = true;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.World;
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Utilities;
|
||||
|
||||
namespace CalamityMod.NPCs.AbyssNPCs
|
||||
{
|
||||
@@ -319,8 +320,10 @@ namespace CalamityMod.NPCs.AbyssNPCs
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CloakingGland"));
|
||||
}
|
||||
}
|
||||
}
|
||||
int inkBombDropRate = CalamityWorld.defiled ? DropHelper.DefiledDropRateInt : Main.expertMode ? 50 : 100;
|
||||
DropHelper.DropItemChance(npc, mod.ItemType("InkBomb"), inkBombDropRate, 1, 1);
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
{
|
||||
|
||||
@@ -31,7 +31,8 @@ namespace CalamityMod.NPCs.AbyssNPCs
|
||||
npc.width = 254; //36
|
||||
npc.height = 138; //20
|
||||
npc.defense = 3000;
|
||||
npc.lifeMax = 1000000;
|
||||
npc.takenDamageMultiplier = 1E-6f;
|
||||
npc.lifeMax = 1000000;
|
||||
npc.aiStyle = -1;
|
||||
aiType = -1;
|
||||
for (int k = 0; k < npc.buffImmune.Length; k++)
|
||||
|
||||
@@ -97,10 +97,11 @@ namespace CalamityMod.NPCs.AbyssNPCs
|
||||
npc.TargetClosest(false);
|
||||
if ((Main.player[npc.target].wet && !Main.player[npc.target].dead &&
|
||||
Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height) &&
|
||||
(Main.player[npc.target].Center - npc.Center).Length() < ((Main.player[npc.target].GetCalamityPlayer().anechoicPlating ||
|
||||
Main.player[npc.target].GetCalamityPlayer().anechoicCoating) ? 300f : 500f) *
|
||||
(Main.player[npc.target].GetCalamityPlayer().fishAlert ? 3f : 1f)) ||
|
||||
npc.justHit)
|
||||
//(Main.player[npc.target].Center - npc.Center).Length() < ((Main.player[npc.target].GetCalamityPlayer().anechoicPlating ||
|
||||
//Main.player[npc.target].GetCalamityPlayer().anechoicCoating) ? 300f : 500f) *
|
||||
//(Main.player[npc.target].GetCalamityPlayer().fishAlert ? 3f : 1f)) ||
|
||||
(Main.player[npc.target].Center - npc.Center).Length() < Main.player[npc.target].GetCalamityPlayer().GetAbyssAggro(500f, 300f)) ||
|
||||
npc.justHit)
|
||||
{
|
||||
hasBeenHit = true;
|
||||
}
|
||||
|
||||
@@ -63,9 +63,10 @@ namespace CalamityMod.NPCs.AbyssNPCs
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if ((Main.player[npc.target].Center - npc.Center).Length() < ((Main.player[npc.target].GetCalamityPlayer().anechoicPlating ||
|
||||
Main.player[npc.target].GetCalamityPlayer().anechoicCoating) ? 100f : 600f) *
|
||||
(Main.player[npc.target].GetCalamityPlayer().fishAlert ? 3f : 1f) ||
|
||||
//if ((Main.player[npc.target].Center - npc.Center).Length() < ((Main.player[npc.target].GetCalamityPlayer().anechoicPlating ||
|
||||
// Main.player[npc.target].GetCalamityPlayer().anechoicCoating) ? 100f : 600f) *
|
||||
// (Main.player[npc.target].GetCalamityPlayer().fishAlert ? 3f : 1f) ||
|
||||
if ((Main.player[npc.target].Center - npc.Center).Length() < Main.player[npc.target].GetCalamityPlayer().GetAbyssAggro(600f, 100f) ||
|
||||
npc.justHit)
|
||||
{
|
||||
detectsPlayer = true;
|
||||
|
||||
@@ -70,10 +70,11 @@ namespace CalamityMod.NPCs.AbyssNPCs
|
||||
npc.TargetClosest(false);
|
||||
if (Main.player[npc.target].wet && !Main.player[npc.target].dead &&
|
||||
Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height) &&
|
||||
(Main.player[npc.target].Center - npc.Center).Length() < ((Main.player[npc.target].GetCalamityPlayer().anechoicPlating ||
|
||||
Main.player[npc.target].GetCalamityPlayer().anechoicCoating) ? 200f : 400f) *
|
||||
(Main.player[npc.target].GetCalamityPlayer().fishAlert ? 3f : 1f))
|
||||
{
|
||||
//(Main.player[npc.target].Center - npc.Center).Length() < ((Main.player[npc.target].GetCalamityPlayer().anechoicPlating ||
|
||||
//Main.player[npc.target].GetCalamityPlayer().anechoicCoating) ? 200f : 400f) *
|
||||
//(Main.player[npc.target].GetCalamityPlayer().fishAlert ? 3f : 1f))
|
||||
(Main.player[npc.target].Center - npc.Center).Length() < Main.player[npc.target].GetCalamityPlayer().GetAbyssAggro(400f, 200f))
|
||||
{
|
||||
flag14 = true;
|
||||
}
|
||||
if ((!Main.player[npc.target].wet || Main.player[npc.target].dead) && flag14)
|
||||
|
||||
@@ -69,10 +69,11 @@ namespace CalamityMod.NPCs.AbyssNPCs
|
||||
npc.TargetClosest(false);
|
||||
if (Main.player[npc.target].wet && !Main.player[npc.target].dead &&
|
||||
Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height) &&
|
||||
(Main.player[npc.target].Center - npc.Center).Length() < ((Main.player[npc.target].GetCalamityPlayer().anechoicPlating ||
|
||||
Main.player[npc.target].GetCalamityPlayer().anechoicCoating) ? 250f : 300f) *
|
||||
(Main.player[npc.target].GetCalamityPlayer().fishAlert ? 3f : 1f))
|
||||
{
|
||||
//(Main.player[npc.target].Center - npc.Center).Length() < ((Main.player[npc.target].GetCalamityPlayer().anechoicPlating ||
|
||||
//Main.player[npc.target].GetCalamityPlayer().anechoicCoating) ? 250f : 300f) *
|
||||
//(Main.player[npc.target].GetCalamityPlayer().fishAlert ? 3f : 1f))
|
||||
(Main.player[npc.target].Center - npc.Center).Length() < Main.player[npc.target].GetCalamityPlayer().GetAbyssAggro(300f, 250f))
|
||||
{
|
||||
flag14 = true;
|
||||
}
|
||||
if ((!Main.player[npc.target].wet || Main.player[npc.target].dead) && flag14)
|
||||
|
||||
@@ -131,9 +131,10 @@ namespace CalamityMod.NPCs.AbyssNPCs
|
||||
{
|
||||
num42 *= 16;
|
||||
float num47 = (float)(num42 - 200); //800
|
||||
if ((Main.player[npc.target].Center - npc.Center).Length() > ((Main.player[npc.target].GetCalamityPlayer().anechoicPlating ||
|
||||
Main.player[npc.target].GetCalamityPlayer().anechoicCoating) ? 150f : 250f) *
|
||||
(Main.player[npc.target].GetCalamityPlayer().fishAlert ? 3f : 1f))
|
||||
//if ((Main.player[npc.target].Center - npc.Center).Length() > ((Main.player[npc.target].GetCalamityPlayer().anechoicPlating ||
|
||||
// Main.player[npc.target].GetCalamityPlayer().anechoicCoating) ? 150f : 250f) *
|
||||
// (Main.player[npc.target].GetCalamityPlayer().fishAlert ? 3f : 1f))
|
||||
if ((Main.player[npc.target].Center - npc.Center).Length() < Main.player[npc.target].GetCalamityPlayer().GetAbyssAggro(250f, 150f))
|
||||
{
|
||||
num192 = num47;
|
||||
if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) < 250f)
|
||||
@@ -165,10 +166,11 @@ namespace CalamityMod.NPCs.AbyssNPCs
|
||||
npc.velocity *= num49;
|
||||
}
|
||||
}
|
||||
if ((Main.player[npc.target].Center - npc.Center).Length() > ((Main.player[npc.target].GetCalamityPlayer().anechoicPlating ||
|
||||
Main.player[npc.target].GetCalamityPlayer().anechoicCoating) ? 150f : 250f) *
|
||||
(Main.player[npc.target].GetCalamityPlayer().fishAlert ? 3f : 1f))
|
||||
{
|
||||
//if ((Main.player[npc.target].Center - npc.Center).Length() > ((Main.player[npc.target].GetCalamityPlayer().anechoicPlating ||
|
||||
// Main.player[npc.target].GetCalamityPlayer().anechoicCoating) ? 150f : 250f) *
|
||||
// (Main.player[npc.target].GetCalamityPlayer().fishAlert ? 3f : 1f))
|
||||
if ((Main.player[npc.target].Center - npc.Center).Length() < Main.player[npc.target].GetCalamityPlayer().GetAbyssAggro(250f, 150f))
|
||||
{
|
||||
for (int num51 = 0; num51 < 200; num51++)
|
||||
{
|
||||
if (Main.npc[num51].active && Main.npc[num51].type == npc.type && num51 != npc.whoAmI)
|
||||
|
||||
@@ -149,12 +149,14 @@ namespace CalamityMod.NPCs.AbyssNPCs
|
||||
npc.TargetClosest(false);
|
||||
if ((!Main.player[npc.target].dead &&
|
||||
Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height) &&
|
||||
(Main.player[npc.target].Center - npc.Center).Length() < ((Main.player[npc.target].GetCalamityPlayer().anechoicPlating ||
|
||||
Main.player[npc.target].GetCalamityPlayer().anechoicCoating) ? 300f : 500f) *
|
||||
(Main.player[npc.target].GetCalamityPlayer().fishAlert ? 3f : 1f)) ||
|
||||
npc.justHit)
|
||||
{
|
||||
hasBeenHit = true;
|
||||
//(Main.player[npc.target].Center - npc.Center).Length() < ((Main.player[npc.target].GetCalamityPlayer().anechoicPlating ||
|
||||
//Main.player[npc.target].GetCalamityPlayer().anechoicCoating) ? 300f : 500f) *
|
||||
//(Main.player[npc.target].GetCalamityPlayer().fishAlert ? 3f : 1f))
|
||||
(Main.player[npc.target].Center - npc.Center).Length() < Main.player[npc.target].GetCalamityPlayer().GetAbyssAggro(500f, 300f)) ||
|
||||
npc.justHit)
|
||||
|
||||
{
|
||||
hasBeenHit = true;
|
||||
}
|
||||
if (!flag14)
|
||||
{
|
||||
|
||||
@@ -70,10 +70,13 @@ namespace CalamityMod.NPCs.AbyssNPCs
|
||||
npc.TargetClosest(false);
|
||||
if (Main.player[npc.target].wet && !Main.player[npc.target].dead &&
|
||||
Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height) &&
|
||||
(Main.player[npc.target].Center - npc.Center).Length() < ((Main.player[npc.target].GetCalamityPlayer().anechoicPlating ||
|
||||
Main.player[npc.target].GetCalamityPlayer().anechoicCoating) ? 200f : 600f) *
|
||||
(Main.player[npc.target].GetCalamityPlayer().fishAlert ? 3f : 1f))
|
||||
{
|
||||
//(Main.player[npc.target].Center - npc.Center).Length() < ((Main.player[npc.target].GetCalamityPlayer().anechoicPlating ||
|
||||
//Main.player[npc.target].GetCalamityPlayer().anechoicCoating) ? 200f : 600f) *
|
||||
//(Main.player[npc.target].GetCalamityPlayer().fishAlert ? 3f : 1f) *
|
||||
// (Main.player[npc.target].GetCalamityPlayer().abyssalMirror ? 0.7f : 1f) *
|
||||
// (Main.player[npc.target].GetCalamityPlayer().eclipseMirror ? 0.3f : 1f))
|
||||
(Main.player[npc.target].Center - npc.Center).Length() < Main.player[npc.target].GetCalamityPlayer().GetAbyssAggro(600f, 200f))
|
||||
{
|
||||
flag14 = true;
|
||||
}
|
||||
if ((!Main.player[npc.target].wet || Main.player[npc.target].dead) && flag14)
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
using System;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.World;
|
||||
using CalamityMod.CalPlayer;
|
||||
using MonoMod.Cil;
|
||||
using static Terraria.ModLoader.ModContent;
|
||||
|
||||
namespace CalamityMod.NPCs.AstralBiomeNPCs
|
||||
{
|
||||
public class Twinkler : ModNPC
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Twinkler");
|
||||
Main.npcFrameCount[npc.type] = 8;
|
||||
Main.npcCatchable[npc.type] = true;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
npc.CloneDefaults(NPCID.LightningBug); //ID is 358
|
||||
npc.width = 7;
|
||||
npc.height = 5;
|
||||
aiType = NPCID.LightningBug;
|
||||
animationType = NPCID.LightningBug;
|
||||
npc.catchItem = (short)mod.ItemType("TwinklerItem");
|
||||
npc.friendly = true; // We have to add this and CanBeHitByItem/CanBeHitByProjectile because of reasons.
|
||||
//banner = npc.type;
|
||||
//bannerItem = mod.ItemType("TwinklerBanner");
|
||||
}
|
||||
|
||||
|
||||
public override bool? CanBeHitByItem(Player player, Item item) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool? CanBeHitByProjectile(Projectile projectile) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage) {
|
||||
if (npc.life <= 0) {
|
||||
for (int i = 0; i < 6; i++) {
|
||||
int dust = Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("AstralOrange"), 2 * hitDirection, -2f);
|
||||
if (Main.rand.NextBool(2)) {
|
||||
Main.dust[dust].noGravity = true;
|
||||
Main.dust[dust].scale = 1.2f * npc.scale;
|
||||
}
|
||||
else {
|
||||
Main.dust[dust].scale = 0.7f * npc.scale;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override float SpawnChance(NPCSpawnInfo spawnInfo)
|
||||
{
|
||||
if (spawnInfo.player.GetModPlayer<CalamityPlayer>().ZoneAstral && !spawnInfo.player.ZoneRockLayerHeight)
|
||||
{
|
||||
return SpawnCondition.TownCritter.Chance;
|
||||
}
|
||||
return 0f;
|
||||
}
|
||||
|
||||
public virtual void OnCatchNPC(Player player, Item item)
|
||||
{
|
||||
try
|
||||
{
|
||||
var npcCenter = npc.Center.ToTileCoordinates();
|
||||
if (!WorldGen.SolidTile(npcCenter.X, npcCenter.Y) && Main.tile[npcCenter.X, npcCenter.Y].liquid == 0)
|
||||
{
|
||||
Main.tile[npcCenter.X, npcCenter.Y].liquid = (byte)Main.rand.Next(50, 150);
|
||||
Main.tile[npcCenter.X, npcCenter.Y].lava(true);
|
||||
Main.tile[npcCenter.X, npcCenter.Y].honey(false);
|
||||
WorldGen.SquareTileFrame(npcCenter.X, npcCenter.Y, true);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal class TwinklerItem : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Twinkler");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.useStyle = 1;
|
||||
item.autoReuse = true;
|
||||
item.useTurn = true;
|
||||
item.useAnimation = 15;
|
||||
item.useTime = 10;
|
||||
item.maxStack = 999;
|
||||
item.consumable = true;
|
||||
item.noUseGraphic = true;
|
||||
item.value = Item.buyPrice(0, 0, 40, 0);
|
||||
//item.CloneDefaults(2004); //Lightning Bug item
|
||||
item.width = 26;
|
||||
item.height = 24;
|
||||
item.bait = 40;
|
||||
item.makeNPC = (short)mod.NPCType("Twinkler");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 650 B |
@@ -1,3 +1,5 @@
|
||||
using CalamityMod.Buffs.DoTDebuffs;
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Projectiles;
|
||||
using CalamityMod.Utilities;
|
||||
@@ -17,9 +19,7 @@ namespace CalamityMod.NPCs
|
||||
public class CalamityGlobalNPC : GlobalNPC
|
||||
{
|
||||
#region Variables
|
||||
// Damage reduction
|
||||
private float protection = 0f;
|
||||
private float defProtection = 0f;
|
||||
private float DR = 0f;
|
||||
|
||||
// Iron Heart
|
||||
private int ironHeartDamage = 0;
|
||||
@@ -564,11 +564,6 @@ namespace CalamityMod.NPCs
|
||||
{
|
||||
IronHeartChanges(npc);
|
||||
}
|
||||
|
||||
if (protection > 0f)
|
||||
{
|
||||
defProtection = protection;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -834,30 +829,30 @@ namespace CalamityMod.NPCs
|
||||
if (npc.type == thorium.NPCType("Viscount") || npc.type == thorium.NPCType("BoreanStrider") || npc.type == thorium.NPCType("FallenDeathBeholder") ||
|
||||
npc.type == thorium.NPCType("Lich") || npc.type == thorium.NPCType("AbyssionReleased"))
|
||||
{
|
||||
protection = 0.05f;
|
||||
DR = 0.05f;
|
||||
}
|
||||
else if (npc.type == thorium.NPCType("CryoCore") || npc.type == thorium.NPCType("BioCore") || npc.type == thorium.NPCType("PyroCore") ||
|
||||
npc.type == thorium.NPCType("Aquaius"))
|
||||
{
|
||||
protection = 0.1f;
|
||||
DR = 0.1f;
|
||||
}
|
||||
else if (npc.type == thorium.NPCType("ThePrimeScouter") || npc.type == thorium.NPCType("FallenDeathBeholder2") || npc.type == thorium.NPCType("SlagFury") ||
|
||||
npc.type == thorium.NPCType("Aquaius2") || npc.type == thorium.NPCType("GraniteEnergyStorm"))
|
||||
{
|
||||
protection = 0.2f;
|
||||
DR = 0.2f;
|
||||
}
|
||||
else if (npc.type == thorium.NPCType("TheBuriedWarrior") || npc.type == thorium.NPCType("TheBuriedWarrior1") || npc.type == thorium.NPCType("TheBuriedWarrior2") ||
|
||||
npc.type == thorium.NPCType("LichHeadless") || npc.type == thorium.NPCType("AbyssionCracked"))
|
||||
{
|
||||
protection = 0.25f;
|
||||
DR = 0.25f;
|
||||
}
|
||||
else if (npc.type == thorium.NPCType("Omnicide"))
|
||||
{
|
||||
protection = 0.3f;
|
||||
DR = 0.3f;
|
||||
}
|
||||
else if (npc.type == thorium.NPCType("Abyssion"))
|
||||
{
|
||||
protection = 0.35f;
|
||||
DR = 0.35f;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -867,7 +862,7 @@ namespace CalamityMod.NPCs
|
||||
npc.type == mod.NPCType("ScornEater") || npc.type == mod.NPCType("AquaticScourgeBody") || npc.type == mod.NPCType("AquaticScourgeBodyAlt") ||
|
||||
npc.type == mod.NPCType("Mauler") || npc.type == mod.NPCType("EutrophicRay"))
|
||||
{
|
||||
protection = 0.05f;
|
||||
DR = 0.05f;
|
||||
}
|
||||
else if (npc.type == mod.NPCType("AstrumDeusBody") || npc.type == mod.NPCType("SoulSeeker") || npc.type == mod.NPCType("DesertScourgeTail") ||
|
||||
npc.type == mod.NPCType("Horse") || npc.type == mod.NPCType("ProfanedEnergyBody") || npc.type == mod.NPCType("ScavengerClawLeft") ||
|
||||
@@ -875,7 +870,7 @@ namespace CalamityMod.NPCs
|
||||
npc.type == mod.NPCType("PhantomDebris") || npc.type == mod.NPCType("AstrumDeusHead") || npc.type == mod.NPCType("AquaticScourgeHead") ||
|
||||
npc.type == mod.NPCType("Cryon") || npc.type == mod.NPCType("Cryogen"))
|
||||
{
|
||||
protection = 0.1f;
|
||||
DR = 0.1f;
|
||||
}
|
||||
else if (npc.type == mod.NPCType("ArmoredDiggerHead") || npc.type == mod.NPCType("AstralProbe") || npc.type == mod.NPCType("Calamitas") ||
|
||||
npc.type == mod.NPCType("CalamitasRun") || npc.type == mod.NPCType("CalamitasRun2") || npc.type == mod.NPCType("CalamitasRun3") ||
|
||||
@@ -888,39 +883,39 @@ namespace CalamityMod.NPCs
|
||||
npc.type == mod.NPCType("Hive") || npc.type == mod.NPCType("Mantis") || npc.type == mod.NPCType("Nova") || npc.type == mod.NPCType("SmallSightseer") ||
|
||||
npc.type == mod.NPCType("StellarCulex"))
|
||||
{
|
||||
protection = 0.15f;
|
||||
DR = 0.15f;
|
||||
}
|
||||
else if (npc.type == mod.NPCType("AstrumDeusProbe3") || npc.type == mod.NPCType("PlaguebringerShade") || npc.type == mod.NPCType("BlindedAngler"))
|
||||
{
|
||||
protection = 0.2f;
|
||||
DR = 0.2f;
|
||||
}
|
||||
else if (npc.type == mod.NPCType("PlaguebringerGoliath") || npc.type == mod.NPCType("ProfanedGuardianBoss2") || npc.type == mod.NPCType("SandTortoise") ||
|
||||
npc.type == mod.NPCType("StasisProbe") || npc.type == mod.NPCType("BobbitWormHead") || npc.type == mod.NPCType("GreatSandShark") ||
|
||||
npc.type == mod.NPCType("Clam") || npc.type == mod.NPCType("PrismTurtle"))
|
||||
{
|
||||
protection = 0.25f;
|
||||
DR = 0.25f;
|
||||
}
|
||||
else if (npc.type == mod.NPCType("ProvSpawnOffense") || npc.type == mod.NPCType("GiantClam"))
|
||||
{
|
||||
protection = 0.3f;
|
||||
DR = 0.3f;
|
||||
}
|
||||
else if (npc.type == mod.NPCType("ArmoredDiggerBody") || npc.type == mod.NPCType("AstrumDeusTail") || npc.type == mod.NPCType("DespairStone") ||
|
||||
npc.type == mod.NPCType("SoulSeekerSupreme") || npc.type == mod.NPCType("Leviathan"))
|
||||
{
|
||||
protection = 0.35f;
|
||||
DR = 0.35f;
|
||||
}
|
||||
else if (npc.type == mod.NPCType("CryogenIce") || npc.type == mod.NPCType("ProfanedGuardianBoss") || npc.type == mod.NPCType("ProvSpawnDefense") ||
|
||||
npc.type == mod.NPCType("ScavengerBody"))
|
||||
{
|
||||
protection = 0.4f;
|
||||
DR = 0.4f;
|
||||
}
|
||||
else if (npc.type == mod.NPCType("ArmoredDiggerTail"))
|
||||
{
|
||||
protection = 0.45f;
|
||||
DR = 0.45f;
|
||||
}
|
||||
else if (npc.type == mod.NPCType("SirenIce"))
|
||||
{
|
||||
protection = 0.5f;
|
||||
DR = 0.5f;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -939,7 +934,7 @@ namespace CalamityMod.NPCs
|
||||
case NPCID.CultistBoss:
|
||||
case NPCID.Crab:
|
||||
case NPCID.SeaSnail:
|
||||
protection = 0.05f;
|
||||
DR = 0.05f;
|
||||
break;
|
||||
|
||||
case NPCID.Antlion:
|
||||
@@ -961,7 +956,7 @@ namespace CalamityMod.NPCs
|
||||
case NPCID.ArmoredViking:
|
||||
case NPCID.DD2Betsy:
|
||||
case NPCID.DD2OgreT2:
|
||||
protection = 0.1f;
|
||||
DR = 0.1f;
|
||||
break;
|
||||
|
||||
case NPCID.ElfCopter:
|
||||
@@ -969,7 +964,7 @@ namespace CalamityMod.NPCs
|
||||
case NPCID.ArmoredSkeleton:
|
||||
case NPCID.PirateShipCannon:
|
||||
case NPCID.DD2OgreT3:
|
||||
protection = 0.15f;
|
||||
DR = 0.15f;
|
||||
break;
|
||||
|
||||
case NPCID.Retinazer:
|
||||
@@ -1015,7 +1010,7 @@ namespace CalamityMod.NPCs
|
||||
case NPCID.GiantShelly:
|
||||
case NPCID.GiantShelly2:
|
||||
case NPCID.Mothron:
|
||||
protection = 0.2f;
|
||||
DR = 0.2f;
|
||||
break;
|
||||
|
||||
case NPCID.PrimeSaw:
|
||||
@@ -1028,7 +1023,7 @@ namespace CalamityMod.NPCs
|
||||
case NPCID.GolemFistRight:
|
||||
case NPCID.GolemHead:
|
||||
case NPCID.GolemHeadFree:
|
||||
protection = 0.25f;
|
||||
DR = 0.25f;
|
||||
break;
|
||||
|
||||
case NPCID.Mimic:
|
||||
@@ -1037,7 +1032,7 @@ namespace CalamityMod.NPCs
|
||||
case NPCID.BigMimicCrimson:
|
||||
case NPCID.BigMimicHallow:
|
||||
case NPCID.BigMimicJungle:
|
||||
protection = 0.3f;
|
||||
DR = 0.3f;
|
||||
break;
|
||||
|
||||
case NPCID.GiantTortoise:
|
||||
@@ -1045,24 +1040,24 @@ namespace CalamityMod.NPCs
|
||||
case NPCID.SantaNK1:
|
||||
case NPCID.MartianWalker:
|
||||
case NPCID.TheDestroyerTail:
|
||||
protection = 0.35f;
|
||||
DR = 0.35f;
|
||||
break;
|
||||
|
||||
case NPCID.DeadlySphere:
|
||||
protection = 0.4f;
|
||||
DR = 0.4f;
|
||||
break;
|
||||
|
||||
case NPCID.Paladin:
|
||||
protection = 0.45f;
|
||||
DR = 0.45f;
|
||||
break;
|
||||
|
||||
case NPCID.WallofFlesh:
|
||||
case NPCID.MothronEgg:
|
||||
protection = 0.5f;
|
||||
DR = 0.5f;
|
||||
break;
|
||||
|
||||
case NPCID.DungeonGuardian:
|
||||
protection = 0.999999f;
|
||||
DR = 0.999999f;
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -1351,6 +1346,7 @@ namespace CalamityMod.NPCs
|
||||
#region Strike NPC
|
||||
public override bool StrikeNPC(NPC npc, ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit)
|
||||
{
|
||||
// TODO -- move this to Destroyer's Rev+ AI; either set his DR or modify npc.takenDamageMultiplier
|
||||
if (npc.type == NPCID.TheDestroyer || npc.type == NPCID.TheDestroyerBody || npc.type == NPCID.TheDestroyerTail)
|
||||
{
|
||||
if ((newAI[1] < 480f || newAI[2] > 0f) && (CalamityWorld.revenge || CalamityWorld.bossRushActive))
|
||||
@@ -1358,99 +1354,83 @@ namespace CalamityMod.NPCs
|
||||
damage *= 0.01;
|
||||
}
|
||||
}
|
||||
else if (npc.type == mod.NPCType("SCalWormBody") || npc.type == mod.NPCType("SCalWormHead") || npc.type == mod.NPCType("SCalWormBodyWeak") || npc.type == mod.NPCType("SCalWormTail") || npc.type == mod.NPCType("EidolonWyrmHeadHuge"))
|
||||
{
|
||||
damage *= 0.000001;
|
||||
}
|
||||
|
||||
double yellowCandleDamageBoost = damage * 0.05; // Get value before DR
|
||||
// Yellow Candle provides +5% damage which ignores both DR and defense.
|
||||
// However, armor penetration bonus damage has already been applied, so it's slightly higher than it should be.
|
||||
double yellowCandleDamage = 0.05 * damage;
|
||||
|
||||
int newDefense = npc.defense -
|
||||
(pFlames ? 4 : 0) -
|
||||
(wDeath ? 50 : 0) -
|
||||
(gsInferno ? 20 : 0) -
|
||||
(astralInfection ? 8 : 0) -
|
||||
(aFlames ? 10 : 0) -
|
||||
(wCleave ? 15 : 0);
|
||||
// Apply modifications to enemy's current defense based on Calamity debuffs.
|
||||
// As with defense and DR, flat reductions apply first, then multiplicative reductions.
|
||||
int effectiveDefense = npc.defense -
|
||||
(pFlames ? Plague.DefenseReduction : 0) -
|
||||
(wDeath ? WhisperingDeath.DefenseReduction : 0) -
|
||||
(gsInferno ? GodSlayerInferno.DefenseReduction : 0) -
|
||||
(astralInfection ? AstralInfectionDebuff.DefenseReduction : 0) -
|
||||
(aFlames ? AbyssalFlames.DefenseReduction : 0) -
|
||||
(wCleave ? WarCleave.DefenseReduction : 0);
|
||||
|
||||
if (gState)
|
||||
{
|
||||
newDefense /= 2;
|
||||
}
|
||||
|
||||
effectiveDefense /= 2;
|
||||
if (aCrunch)
|
||||
{
|
||||
newDefense /= 3;
|
||||
}
|
||||
effectiveDefense /= 3;
|
||||
|
||||
if (newDefense < 0)
|
||||
{
|
||||
newDefense = 0;
|
||||
}
|
||||
// Defense can never be negative and has a minimum value of zero.
|
||||
if (effectiveDefense < 0)
|
||||
effectiveDefense = 0;
|
||||
|
||||
defense = newDefense;
|
||||
// Apply vanilla-style defense before DR, using Calamity's reduced defense.
|
||||
damage = Main.CalculateDamage((int)damage, effectiveDefense);
|
||||
|
||||
if (protection > 0f)
|
||||
{
|
||||
double newDamage = damage + (defense * 0.25); //defense damage boost 150 * .25 = 45 + 150 = 195 damage 180 defense
|
||||
// DR applies after vanilla defense.
|
||||
damage = ApplyDR(npc, damage);
|
||||
|
||||
if (marked)
|
||||
{
|
||||
protection *= 0.5f;
|
||||
}
|
||||
// Add Yellow Candle damage if the NPC isn't supposed to be "near invincible"
|
||||
if (yellowCandle && DR < 0.99f && npc.takenDamageMultiplier > 0.05f)
|
||||
damage += yellowCandleDamage;
|
||||
|
||||
if (npc.betsysCurse)
|
||||
{
|
||||
protection *= 0.66f;
|
||||
}
|
||||
|
||||
if (wCleave)
|
||||
{
|
||||
protection *= 0.75f;
|
||||
}
|
||||
|
||||
if (npc.ichor)
|
||||
{
|
||||
protection *= 0.75f;
|
||||
}
|
||||
else if (npc.onFire2)
|
||||
{
|
||||
protection *= 0.8f;
|
||||
}
|
||||
|
||||
if (protection < 0f)
|
||||
{
|
||||
protection = 0f;
|
||||
}
|
||||
|
||||
if (newDamage >= 1.0)
|
||||
{
|
||||
newDamage = (1f - protection) * newDamage; //DR calc 195 * 0.4 = 78 damage 0.6 DR
|
||||
|
||||
if (newDamage < 1.0)
|
||||
{
|
||||
newDamage = 1.0;
|
||||
}
|
||||
}
|
||||
|
||||
damage = newDamage;
|
||||
protection = defProtection;
|
||||
}
|
||||
|
||||
if (protection < 0.99f)
|
||||
{
|
||||
if (yellowCandle)
|
||||
{
|
||||
damage += yellowCandleDamageBoost;
|
||||
}
|
||||
}
|
||||
|
||||
return true; //vanilla defense calc 78 - (180 / 2 = 90) = 0, boosted to 1 by calc
|
||||
// Cancel out vanilla defense math by reversing the calculation vanilla is about to perform.
|
||||
// While roundabout, this is safer than returning false to stop vanilla damage calculations entirely.
|
||||
// Other mods will probably expect the vanilla code to run and may compensate for it themselves.
|
||||
damage = Main.CalculateDamage((int)damage, -defense);
|
||||
return true;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Boss Head Slot
|
||||
public override void BossHeadSlot(NPC npc, ref int index)
|
||||
/// <summary>
|
||||
/// Modifies damage incoming to an NPC based on their DR (damage reduction) stat added by Calamity.<br></br>
|
||||
/// This is entirely separate from vanilla's takenDamageMultiplier.
|
||||
/// </summary>
|
||||
/// <param name="damage">Incoming damage. Has been modified by Main.DamageVar and boosted by armor penetration, but nothing else.</param>
|
||||
/// <returns></returns>
|
||||
private double ApplyDR(NPC npc, double damage)
|
||||
{
|
||||
if (DR <= 0f || damage <= 1.0)
|
||||
return damage;
|
||||
|
||||
float effectiveDR = DR;
|
||||
if (marked)
|
||||
effectiveDR *= 0.5f;
|
||||
if (npc.betsysCurse)
|
||||
effectiveDR *= 0.66f;
|
||||
if (wCleave)
|
||||
effectiveDR *= 0.75f;
|
||||
|
||||
// Ichor and Cursed Flames are mutually exclusive
|
||||
if (npc.ichor)
|
||||
effectiveDR *= 0.75f;
|
||||
else if (npc.onFire2)
|
||||
effectiveDR *= 0.8f;
|
||||
|
||||
// DR floor is 0%. Nothing can have negative DR.
|
||||
if (effectiveDR <= 0f)
|
||||
effectiveDR = 0f;
|
||||
|
||||
double newDamage = (1f - effectiveDR) * damage;
|
||||
return newDamage < 1.0 ? 1.0 : newDamage;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Boss Head Slot
|
||||
public override void BossHeadSlot(NPC npc, ref int index)
|
||||
{
|
||||
if (CalamityWorld.revenge)
|
||||
{
|
||||
@@ -2564,7 +2544,7 @@ namespace CalamityMod.NPCs
|
||||
public override void OnHitByProjectile(NPC npc, Projectile projectile, int damage, float knockback, bool crit)
|
||||
{
|
||||
bool isSummon = projectile.minion || projectile.sentry || CalamityMod.projectileMinionList.Contains(projectile.type);
|
||||
|
||||
|
||||
if (Main.player[projectile.owner].GetCalamityPlayer().sGenerator)
|
||||
{
|
||||
if (isSummon && npc.damage > 0)
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.World;
|
||||
|
||||
namespace CalamityMod.NPCs.HiveMind
|
||||
{
|
||||
@@ -43,6 +44,10 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
else if (NPC.downedBoss2 && !CalamityWorld.downedHiveMind)
|
||||
{
|
||||
return SpawnCondition.Corruption.Chance * 1.5f;
|
||||
}
|
||||
return SpawnCondition.Corruption.Chance * (Main.hardMode ? 0.05f : 0.5f);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.World;
|
||||
|
||||
namespace CalamityMod.NPCs.Perforator
|
||||
{
|
||||
@@ -43,6 +44,10 @@ namespace CalamityMod.NPCs.Perforator
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
else if (NPC.downedBoss2 && !CalamityWorld.downedPerforator)
|
||||
{
|
||||
return SpawnCondition.Crimson.Chance * 1.5f;
|
||||
}
|
||||
return SpawnCondition.Crimson.Chance * (Main.hardMode ? 0.05f : 0.5f);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
npc.width = 26; //28
|
||||
npc.height = 18; //28
|
||||
npc.defense = 0;
|
||||
npc.takenDamageMultiplier = 1E-6f;
|
||||
npc.lifeMax = CalamityWorld.revenge ? 1200000 : 1000000;
|
||||
if (CalamityWorld.death)
|
||||
{
|
||||
|
||||
@@ -30,7 +30,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
npc.aiStyle = 6;
|
||||
aiType = -1;
|
||||
npc.knockBackResist = 0f;
|
||||
npc.scale = 1.2f;
|
||||
npc.takenDamageMultiplier = 1E-6f;
|
||||
npc.scale = 1.2f;
|
||||
if (Main.expertMode)
|
||||
{
|
||||
npc.scale = 1.35f;
|
||||
|
||||
@@ -29,6 +29,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
npc.width = 56; //324
|
||||
npc.height = 62; //216
|
||||
npc.defense = 0;
|
||||
npc.takenDamageMultiplier = 1E-6f;
|
||||
npc.lifeMax = CalamityWorld.revenge ? 1200000 : 1000000;
|
||||
if (CalamityWorld.death)
|
||||
{
|
||||
|
||||
@@ -20,6 +20,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
npc.width = 26; //324
|
||||
npc.height = 46; //216
|
||||
npc.defense = 0;
|
||||
npc.takenDamageMultiplier = 1E-6f;
|
||||
npc.lifeMax = CalamityWorld.revenge ? 1200000 : 1000000;
|
||||
if (CalamityWorld.death)
|
||||
{
|
||||
|
||||
@@ -116,12 +116,9 @@ namespace CalamityMod.NPCs.TownNPCs
|
||||
PossibleDialogs.Add("Maybe I'm bitter. It's been a long time, so whatever. Just do a good job out there.");
|
||||
PossibleDialogs.Add("It's not stealing! I'm just borrowing it until I die!");
|
||||
|
||||
for (int j = 0; j < Main.LocalPlayer.inventory.Length; j++)
|
||||
if (InventoryHas(Main.LocalPlayer, ItemID.BoneGlove))
|
||||
{
|
||||
if (Main.LocalPlayer.inventory[j].type == ItemID.BoneGlove)
|
||||
{
|
||||
PossibleDialogs.Add("Wouldn't be the first time I used my friends' remains as weapons.");
|
||||
}
|
||||
PossibleDialogs.Add("Wouldn't be the first time I used my friends' remains as weapons.");
|
||||
}
|
||||
if (Main.hardMode)
|
||||
{
|
||||
@@ -135,7 +132,7 @@ namespace CalamityMod.NPCs.TownNPCs
|
||||
PossibleDialogs.Add("Providence HATES it when you take her stuff. I learned that the hard way.");
|
||||
PossibleDialogs.Add("You think I can get away with looting from ghosts? It ain't like they can pick things up.");
|
||||
}
|
||||
if (InventoryHas(Main.LocalPlayer,mod.ItemType("Valediction")) ||
|
||||
if (InventoryHas(Main.LocalPlayer, mod.ItemType("Valediction")) ||
|
||||
InventoryHas(Main.LocalPlayer, mod.ItemType("TheReaper")))
|
||||
{
|
||||
PossibleDialogs.Add("Oh man, did you rip that off a shark!? Now that's a weapon!");
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
{
|
||||
DisplayName.SetDefault("Halley's Comet");
|
||||
}
|
||||
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 20;
|
||||
@@ -97,4 +97,4 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
target.AddBuff(mod.BuffType("Nightwither"), 300);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
{
|
||||
DisplayName.SetDefault("Fire");
|
||||
}
|
||||
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 12;
|
||||
@@ -100,4 +100,4 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
target.AddBuff(BuffID.OnFire, 60 * Main.rand.Next(1,4));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.CalPlayer;
|
||||
|
||||
namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
public class AbyssalMirrorProjectile1 : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Lumenyl Fluid");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 12;
|
||||
projectile.height = 12;
|
||||
projectile.friendly = true;
|
||||
projectile.alpha = 0;
|
||||
projectile.penetrate = -1;
|
||||
projectile.tileCollide = true;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.timeLeft = 50;
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = 2;
|
||||
Mod calamity = ModLoader.GetMod("CalamityMod");
|
||||
projectile.GetGlobalProjectile<CalamityGlobalProjectile>(calamity).rogue = true;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (projectile.timeLeft < 25) { projectile.alpha += 10; }
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
if (!target.friendly && target.rarity != 2 && !CalamityPlayer.areThereAnyDamnBosses)
|
||||
{
|
||||
target.AddBuff(mod.BuffType("SilvaStun"), 300);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 176 B |
@@ -0,0 +1,43 @@
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.CalPlayer;
|
||||
|
||||
namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
public class AbyssalMirrorProjectile2 : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Lumenyl Fluid");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 12;
|
||||
projectile.height = 12;
|
||||
projectile.friendly = true;
|
||||
projectile.alpha = 0;
|
||||
projectile.penetrate = -1;
|
||||
projectile.tileCollide = true;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.timeLeft = 50;
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = 2;
|
||||
Mod calamity = ModLoader.GetMod("CalamityMod");
|
||||
projectile.GetGlobalProjectile<CalamityGlobalProjectile>(calamity).rogue = true;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (projectile.timeLeft < 25) { projectile.alpha += 10; }
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
if (!target.friendly && target.rarity != 2 && !CalamityPlayer.areThereAnyDamnBosses)
|
||||
{
|
||||
target.AddBuff(mod.BuffType("SilvaStun"), 300);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 234 B |
@@ -0,0 +1,43 @@
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.CalPlayer;
|
||||
|
||||
namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
public class AbyssalMirrorProjectile3 : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Lumenyl Fluid");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 12;
|
||||
projectile.height = 12;
|
||||
projectile.friendly = true;
|
||||
projectile.alpha = 0;
|
||||
projectile.penetrate = -1;
|
||||
projectile.tileCollide = true;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.timeLeft = 50;
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = 2;
|
||||
Mod calamity = ModLoader.GetMod("CalamityMod");
|
||||
projectile.GetGlobalProjectile<CalamityGlobalProjectile>(calamity).rogue = true;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (projectile.timeLeft < 25) { projectile.alpha += 10; }
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
if (!target.friendly && target.rarity != 2 && !CalamityPlayer.areThereAnyDamnBosses)
|
||||
{
|
||||
target.AddBuff(mod.BuffType("SilvaStun"), 300);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 265 B |
@@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
public class BlastBarrelProjectile : ModProjectile
|
||||
{
|
||||
public float cooldown = 0f;
|
||||
public float oldVelocityX = 0f;
|
||||
public float oldVelocityX = 0f;
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Barrel");
|
||||
@@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
Vector2 fireVelocity = (Vector2.UnitY * (-16f + Main.rand.NextFloat(-3, 12f))).RotatedByRandom((double)MathHelper.ToRadians(40f));
|
||||
int fireIndex = Projectile.NewProjectile(projectile.Center, projectile.velocity + fireVelocity,
|
||||
Main.rand.Next(ProjectileID.MolotovFire, ProjectileID.MolotovFire3 + 1),
|
||||
Main.rand.Next(ProjectileID.MolotovFire, ProjectileID.MolotovFire3 + 1),
|
||||
BlastBarrel.BaseDamage, 1f, projectile.owner);
|
||||
Main.projectile[fireIndex].thrown = false;
|
||||
Main.projectile[fireIndex].GetGlobalProjectile<CalamityGlobalProjectile>(mod).rogue = true;
|
||||
@@ -97,4 +97,4 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
public class EclipseMirrorBurst : ModProjectile
|
||||
{
|
||||
private int frameCounter = 0;
|
||||
private int frameX = 0;
|
||||
private int frameY = 0;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Eclipse Mirror Flash");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 750;
|
||||
projectile.height = 750;
|
||||
projectile.friendly = true;
|
||||
projectile.alpha = 0;
|
||||
projectile.penetrate = -1;
|
||||
projectile.tileCollide = false;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.timeLeft = 150;
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = 5;
|
||||
Mod calamity = ModLoader.GetMod("CalamityMod");
|
||||
projectile.GetGlobalProjectile<CalamityGlobalProjectile>(calamity).rogue = true;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
frameCounter++;
|
||||
if (frameCounter > 3)
|
||||
{
|
||||
frameCounter = 0;
|
||||
frameY++;
|
||||
if (frameY > 1)
|
||||
{
|
||||
frameX++;
|
||||
frameY = 0;
|
||||
}
|
||||
}
|
||||
if (frameX > 0 && frameY > 0)
|
||||
{
|
||||
projectile.Kill();
|
||||
}
|
||||
}
|
||||
|
||||
public override void PostDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
Texture2D texture = mod.GetTexture("Projectiles/Rogue/EclipseMirrorFlash");
|
||||
spriteBatch.Draw
|
||||
(
|
||||
texture,
|
||||
new Vector2
|
||||
(
|
||||
projectile.position.X - Main.screenPosition.X + projectile.width * 0.5f - 50,
|
||||
projectile.position.Y - Main.screenPosition.Y + projectile.height - 750 * 0.5f - 50
|
||||
),
|
||||
new Rectangle(frameX * 752, frameY * 752, 750, 750),
|
||||
Color.White,
|
||||
projectile.rotation,
|
||||
new Vector2(325, 325),
|
||||
projectile.scale,
|
||||
SpriteEffects.None,
|
||||
0f
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 39 KiB |
@@ -15,7 +15,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
public class EclipsesStealth : ModProjectile
|
||||
{
|
||||
private int deadinside = 0; //used to know when to drop spears from the sky
|
||||
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Eclipse's Stealth");
|
||||
@@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
projectile.localNPCHitCooldown = 30;
|
||||
projectile.GetGlobalProjectile<CalamityGlobalProjectile>(mod).rogue = true;
|
||||
}
|
||||
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
deadinside++; //congrats Pinkie
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
public class InkBombProjectile : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Ink Bomb");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 14;
|
||||
projectile.height = 22;
|
||||
projectile.friendly = true;
|
||||
projectile.alpha = 0;
|
||||
projectile.penetrate = 1;
|
||||
projectile.tileCollide = true;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.timeLeft = 50;
|
||||
Mod calamity = ModLoader.GetMod("CalamityMod");
|
||||
projectile.GetGlobalProjectile<CalamityGlobalProjectile>(calamity).rogue = true;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
projectile.velocity.Y += 0.1f;
|
||||
projectile.rotation += projectile.velocity.X * 0.1f;
|
||||
|
||||
if (projectile.timeLeft == 1)
|
||||
CreateInk();
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
if (!target.friendly)
|
||||
CreateInk();
|
||||
}
|
||||
|
||||
public override bool OnTileCollide(Vector2 oldVelocity)
|
||||
{
|
||||
CreateInk();
|
||||
return true;
|
||||
}
|
||||
|
||||
private void CreateInk()
|
||||
{
|
||||
Main.PlaySound(2, (int)Main.player[Main.myPlayer].position.X, (int)Main.player[Main.myPlayer].position.Y, 14);
|
||||
for (int i = 0; i < 20; i++)
|
||||
{
|
||||
int projType = Main.rand.Next(0, 3);
|
||||
int inkType;
|
||||
switch (projType)
|
||||
{
|
||||
case 0:
|
||||
inkType = mod.ProjectileType("InkCloud");
|
||||
break;
|
||||
case 1:
|
||||
inkType = mod.ProjectileType("InkCloud2");
|
||||
break;
|
||||
default:
|
||||
inkType = mod.ProjectileType("InkCloud3");
|
||||
break;
|
||||
}
|
||||
int inkID = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, Main.rand.NextFloat(-2f, 2f), Main.rand.NextFloat(-2f, 2f), inkType, 22, 7, Main.myPlayer);
|
||||
Main.projectile[inkID].timeLeft += Main.rand.Next(-20, 25);
|
||||
}
|
||||
projectile.Kill();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 432 B |
@@ -0,0 +1,46 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
public class InkCloud : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Ink Cloud");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 32;
|
||||
projectile.height = 28;
|
||||
projectile.friendly = true;
|
||||
projectile.alpha = 0;
|
||||
projectile.penetrate = -1;
|
||||
projectile.tileCollide = true;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.timeLeft = 100;
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = -1;
|
||||
Mod calamity = ModLoader.GetMod("CalamityMod");
|
||||
projectile.GetGlobalProjectile<CalamityGlobalProjectile>(calamity).rogue = true;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (projectile.timeLeft < 50)
|
||||
projectile.alpha += 5;
|
||||
if (projectile.timeLeft < 75)
|
||||
projectile.velocity *= 0.95f;
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
if (!target.friendly)
|
||||
{
|
||||
target.AddBuff(BuffID.Confused, 300);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 464 B |
@@ -0,0 +1,46 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
public class InkCloud2 : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Ink Cloud");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 36;
|
||||
projectile.height = 30;
|
||||
projectile.friendly = true;
|
||||
projectile.alpha = 0;
|
||||
projectile.penetrate = -1;
|
||||
projectile.tileCollide = true;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.timeLeft = 100;
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = -1;
|
||||
Mod calamity = ModLoader.GetMod("CalamityMod");
|
||||
projectile.GetGlobalProjectile<CalamityGlobalProjectile>(calamity).rogue = true;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (projectile.timeLeft < 50)
|
||||
projectile.alpha += 5;
|
||||
if (projectile.timeLeft < 75)
|
||||
projectile.velocity *= 0.95f;
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
if (!target.friendly)
|
||||
{
|
||||
target.AddBuff(BuffID.Confused, 300);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 453 B |
@@ -0,0 +1,46 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
public class InkCloud3 : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Ink Cloud");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 30;
|
||||
projectile.height = 24;
|
||||
projectile.friendly = true;
|
||||
projectile.alpha = 0;
|
||||
projectile.penetrate = -1;
|
||||
projectile.tileCollide = true;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.timeLeft = 100;
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = -1;
|
||||
Mod calamity = ModLoader.GetMod("CalamityMod");
|
||||
projectile.GetGlobalProjectile<CalamityGlobalProjectile>(calamity).rogue = true;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (projectile.timeLeft < 50)
|
||||
projectile.alpha += 5;
|
||||
if (projectile.timeLeft < 75)
|
||||
projectile.velocity *= 0.95f;
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
if (!target.friendly)
|
||||
{
|
||||
target.AddBuff(BuffID.Confused, 300);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 371 B |
@@ -75,4 +75,4 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
target.AddBuff(BuffID.Venom, 240);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 6;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
|
||||
}
|
||||
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 26;
|
||||
@@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
projectile.timeLeft = 1200;
|
||||
projectile.GetGlobalProjectile<CalamityGlobalProjectile>(mod).rogue = true;
|
||||
}
|
||||
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (Main.rand.Next(5) == 0)
|
||||
@@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
Main.dust[num622].velocity *= 1f;
|
||||
}
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
{
|
||||
int num320 = Main.rand.Next(2, 6);
|
||||
int num3;
|
||||
for (int num321 = 0; num321 < num320; num321 = num3 + 1)
|
||||
@@ -83,4 +83,4 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 6;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
|
||||
}
|
||||
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 26;
|
||||
@@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = 60;
|
||||
}
|
||||
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (Main.rand.Next(5) == 0 && projectile.ai[0] != 1f)
|
||||
@@ -199,7 +199,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
Main.dust[num622].velocity *= 1f;
|
||||
}
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
{
|
||||
int num320 = Main.rand.Next(2, 6);
|
||||
int num3;
|
||||
for (int num321 = 0; num321 < num320; num321 = num3 + 1)
|
||||
@@ -219,4 +219,4 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true;
|
||||
Main.projFrames[projectile.type] = 3;
|
||||
}
|
||||
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 36;
|
||||
@@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
projectile.minion = true;
|
||||
target = GetClosestNPCToTarget(maxDistToEnemy, false);
|
||||
}
|
||||
|
||||
|
||||
public int GetClosestNPCToTarget(float maxDistance, bool ignoreTiles)
|
||||
{
|
||||
int closestNPC = -1;
|
||||
@@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
}
|
||||
return closestNPC;
|
||||
}
|
||||
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (projectile.localAI[0] == 0f)
|
||||
@@ -278,7 +278,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
projectile.netUpdate = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Vector2.Distance(player.Center, projectile.Center) <= 1400 & !returningBackToPlayer) //don't return to player if currently busy dealing with an enemy
|
||||
{
|
||||
if (enemyCheckTimer % 240 == 0 & enemyCheckTimer != 0)
|
||||
@@ -293,4 +293,4 @@ namespace CalamityMod.Projectiles.Summon
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -60,4 +60,4 @@ namespace CalamityMod.Tiles
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -84,7 +84,7 @@ namespace CalamityMod.Tiles.FurnitureOccult
|
||||
|
||||
//Left
|
||||
if (
|
||||
CheckTile(Type, true, 1, 0, i, j) && CheckTile(Type, false, 1, 1, i, j) && CheckTile(Type, true, 0, 1, i, j) &&
|
||||
CheckTile(Type, true, 1, 0, i, j) && CheckTile(Type, false, 1, 1, i, j) && CheckTile(Type, true, 0, 1, i, j) &&
|
||||
(CheckTile(Type, true, -1, 1, i, j) || CheckTile(Type, false, -1, 0, i, j))
|
||||
)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.Projectiles;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System.Collections.Generic;
|
||||
@@ -20,7 +22,7 @@ namespace CalamityMod
|
||||
{
|
||||
case 1:
|
||||
return player.GetCalamityPlayer().ZoneAbyssLayer1;
|
||||
|
||||
|
||||
case 2:
|
||||
return player.GetCalamityPlayer().ZoneAbyssLayer2;
|
||||
|
||||
@@ -38,6 +40,8 @@ namespace CalamityMod
|
||||
|
||||
public static class CNPCUtils
|
||||
{
|
||||
public static CalamityGlobalNPC GetCalamityNPC(this NPC npc) => npc.GetGlobalNPC<CalamityGlobalNPC>();
|
||||
|
||||
/// <summary>
|
||||
/// Allows you to set the lifeMax value of a NPC to different values based on the mode. Called instead of npc.lifeMax = X.
|
||||
/// </summary>
|
||||
@@ -66,7 +70,7 @@ namespace CalamityMod
|
||||
if (npc.boss)
|
||||
{
|
||||
double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01;
|
||||
npc.lifeMax += (int)((double)npc.lifeMax * HPBoost);
|
||||
npc.lifeMax += (int)((double)npc.lifeMax * HPBoost);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
@@ -108,6 +112,11 @@ namespace CalamityMod
|
||||
}
|
||||
}
|
||||
|
||||
public static class CProjectileUtils
|
||||
{
|
||||
public static CalamityGlobalProjectile GetCalamityProj(this Projectile proj) => proj.GetGlobalProjectile<CalamityGlobalProjectile>();
|
||||
}
|
||||
|
||||
public static class CMiscUtils
|
||||
{
|
||||
public static void AddWithCondition<T>(this List<T> list, T type, bool condition)
|
||||
|
||||