Merge yada yada
No files matched your search
@@ -0,0 +1,23 @@
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Potions
|
||||
{
|
||||
public class BaguetteBuff : ModBuff
|
||||
{
|
||||
public override void SetDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Baguette");
|
||||
Description.SetDefault("If only I knew... ~Cirrus");
|
||||
Main.debuff[Type] = false;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = false;
|
||||
longerExpertDebuff = false;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
player.Calamity().baguette = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 507 B |
@@ -81,6 +81,8 @@ namespace CalamityMod.CalPlayer
|
||||
public int minionSlotStat = 0;
|
||||
public int lifeRegenStat = 0;
|
||||
public int manaRegenStat = 0;
|
||||
public int ammoReductionRanged = 0;
|
||||
public int ammoReductionRogue = 0;
|
||||
public int armorPenetrationStat = 0;
|
||||
public int wingFlightTimeStat = 0;
|
||||
public int adrenalineChargeStat = 0;
|
||||
@@ -118,8 +120,6 @@ namespace CalamityMod.CalPlayer
|
||||
public bool playRogueStealthSound = false;
|
||||
public bool playFullRageSound = true;
|
||||
public bool playFullAdrenalineSound = true;
|
||||
public bool playAdrenalineBurnoutSound = true;
|
||||
public bool playFullAdrenalineBurnoutSound = true;
|
||||
|
||||
// Proficiency
|
||||
public int meleeLevel = 0;
|
||||
@@ -193,9 +193,6 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
// Adrenaline
|
||||
public int adrenalineMax = 10000;
|
||||
public int adrenalineMaxTimer = 300;
|
||||
public int adrenalineDmgDown = 600;
|
||||
public float adrenalineDmgMult = 1f;
|
||||
public int adrenaline;
|
||||
public int adrenalineCD;
|
||||
public bool adrenalineMode = false;
|
||||
@@ -371,6 +368,9 @@ namespace CalamityMod.CalPlayer
|
||||
public bool dynamoStemCells = false;
|
||||
public bool etherealExtorter = false;
|
||||
public bool blazingCore = false;
|
||||
public bool voltaicJelly = false;
|
||||
public bool jellyChargedBattery = false;
|
||||
public float jellyDmg;
|
||||
//public bool dukeScales = false;
|
||||
public bool sandWaifu = false;
|
||||
public bool sandBoobWaifu = false;
|
||||
@@ -578,6 +578,7 @@ namespace CalamityMod.CalPlayer
|
||||
public bool draconicSurge = false;
|
||||
public int draconicSurgeCooldown = 0;
|
||||
public bool tesla = false;
|
||||
public bool baguette = false;
|
||||
public bool vodka = false;
|
||||
public bool redWine = false;
|
||||
public bool grapeBeer = false;
|
||||
@@ -1161,6 +1162,8 @@ namespace CalamityMod.CalPlayer
|
||||
etherealExtorter = false;
|
||||
//dukeScales = false;
|
||||
blazingCore = false;
|
||||
voltaicJelly = false;
|
||||
jellyChargedBattery = false;
|
||||
veneratedLocket = false;
|
||||
|
||||
daedalusReflect = false;
|
||||
@@ -1302,6 +1305,7 @@ namespace CalamityMod.CalPlayer
|
||||
profanedRage = false;
|
||||
draconicSurge = false;
|
||||
tesla = false;
|
||||
baguette = false;
|
||||
trippy = false;
|
||||
amidiasBlessing = false;
|
||||
yPower = false;
|
||||
@@ -1441,9 +1445,6 @@ namespace CalamityMod.CalPlayer
|
||||
galileoCooldown = 0;
|
||||
stress = 0;
|
||||
adrenaline = 0;
|
||||
adrenalineMaxTimer = 300;
|
||||
adrenalineDmgDown = 600;
|
||||
adrenalineDmgMult = 1f;
|
||||
raiderStack = 0;
|
||||
raiderCooldown = 0;
|
||||
gSabatonFall = 0;
|
||||
@@ -1559,6 +1560,7 @@ namespace CalamityMod.CalPlayer
|
||||
holyWrath = false;
|
||||
profanedRage = false;
|
||||
tesla = false;
|
||||
baguette = false;
|
||||
draconicSurge = false;
|
||||
draconicSurgeCooldown = 0;
|
||||
yPower = false;
|
||||
@@ -2304,7 +2306,7 @@ namespace CalamityMod.CalPlayer
|
||||
player.AddBuff(ModContent.BuffType<RageMode>(), 300);
|
||||
}
|
||||
}
|
||||
if (CalamityMod.AdrenalineHotKey.JustPressed)
|
||||
if (CalamityMod.AdrenalineHotKey.JustPressed && Config.AdrenalineAndRage && CalamityWorld.revenge)
|
||||
{
|
||||
if (adrenaline == adrenalineMax && !adrenalineMode)
|
||||
{
|
||||
@@ -4277,8 +4279,7 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
if (item.melee)
|
||||
{
|
||||
double damageMultAdr = 1.5 * (double)adrenalineDmgMult;
|
||||
damageMult += damageMultAdr;
|
||||
damageMult += 1.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4541,7 +4542,7 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
damageMult += 0.33;
|
||||
}
|
||||
if (CalamityWorld.revenge)
|
||||
if (CalamityWorld.revenge && Config.AdrenalineAndRage)
|
||||
{
|
||||
bool DHorHoD = draedonsHeart || heartOfDarkness;
|
||||
if (rageMode && adrenalineMode)
|
||||
@@ -4567,8 +4568,7 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
if (hasClassType)
|
||||
{
|
||||
double damageMultAdr = 1.5 * (double)adrenalineDmgMult;
|
||||
damageMult += damageMultAdr;
|
||||
damageMult += 1.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5524,7 +5524,7 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
// Fearmonger set provides 15% multiplicative DR that ignores caps during the Holiday Moons.
|
||||
// To prevent abuse, this effect does not work if there are any bosses alive.
|
||||
if(fearmongerSet && !areThereAnyDamnBosses && (Main.pumpkinMoon || Main.snowMoon))
|
||||
if (fearmongerSet && !areThereAnyDamnBosses && (Main.pumpkinMoon || Main.snowMoon))
|
||||
{
|
||||
damage = (int)(damage * 0.85f);
|
||||
}
|
||||
@@ -5540,8 +5540,15 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
if (!CalamityWorld.downedBossAny)
|
||||
damage = (int)((double)damage * 0.8);
|
||||
|
||||
if (Config.AdrenalineAndRage)
|
||||
{
|
||||
if (adrenaline == adrenalineMax && !adrenalineMode)
|
||||
damage = (int)((double)damage * 0.5);
|
||||
}
|
||||
}
|
||||
if (player.mount.Active && (player.mount.Type == ModContent.MountType<AngryDogMount>() || player.mount.Type == ModContent.MountType<OnyxExcavator>()) && Math.Abs(player.velocity.X) > player.mount.RunSpeed / 2f)
|
||||
if (player.mount.Active && (player.mount.Type == ModContent.MountType<AngryDogMount>() || player.mount.Type == ModContent.MountType<OnyxExcavator>())
|
||||
&& Math.Abs(player.velocity.X) > player.mount.RunSpeed / 2f)
|
||||
{
|
||||
damage = (int)((double)damage * 0.9);
|
||||
}
|
||||
@@ -5583,21 +5590,24 @@ namespace CalamityMod.CalPlayer
|
||||
modStealth = 1f;
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
if (rageMode)
|
||||
{
|
||||
stress = 0;
|
||||
if (player.FindBuffIndex(ModContent.BuffType<RageMode>()) > -1)
|
||||
player.ClearBuff(ModContent.BuffType<RageMode>());
|
||||
}
|
||||
if (Config.AdrenalineAndRage && CalamityWorld.revenge)
|
||||
{
|
||||
if (rageMode)
|
||||
{
|
||||
stress = 0;
|
||||
if (player.FindBuffIndex(ModContent.BuffType<RageMode>()) > -1)
|
||||
player.ClearBuff(ModContent.BuffType<RageMode>());
|
||||
}
|
||||
if (!adrenalineMode)
|
||||
{
|
||||
adrenaline = 0;
|
||||
}
|
||||
}
|
||||
if (amidiasBlessing)
|
||||
{
|
||||
player.ClearBuff(ModContent.BuffType<AmidiasBlessing>());
|
||||
Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 96);
|
||||
}
|
||||
if (!adrenalineMode && adrenaline != adrenalineMax)
|
||||
{
|
||||
adrenaline = 0;
|
||||
}
|
||||
if ((gShell || fabledTortoise) && !player.panic)
|
||||
{
|
||||
player.AddBuff(ModContent.BuffType<ShellBoost>(), 300);
|
||||
|
||||
@@ -170,6 +170,8 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
modPlayer.alcoholPoisonLevel++;
|
||||
player.lifeRegen -= 1;
|
||||
if (modPlayer.baguette)
|
||||
player.lifeRegen -= 3;
|
||||
}
|
||||
if (modPlayer.grapeBeer)
|
||||
{
|
||||
|
||||
@@ -168,47 +168,6 @@ namespace CalamityMod.CalPlayer
|
||||
player.AddBuff(ModContent.BuffType<HeartAttack>(), 18000);
|
||||
}
|
||||
|
||||
// Play Adrenaline burnout sounds that happen the more time you wait while having max Adrenaline
|
||||
if (modPlayer.adrenaline >= modPlayer.adrenalineMax)
|
||||
{
|
||||
modPlayer.adrenalineMaxTimer--;
|
||||
if (modPlayer.adrenalineMaxTimer <= 0)
|
||||
{
|
||||
if (modPlayer.playAdrenalineBurnoutSound)
|
||||
{
|
||||
modPlayer.playAdrenalineBurnoutSound = false;
|
||||
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/AdrenalineBurnout1"), (int)player.position.X, (int)player.position.Y);
|
||||
}
|
||||
|
||||
modPlayer.adrenalineDmgDown--;
|
||||
if (modPlayer.adrenalineDmgDown < 0)
|
||||
{
|
||||
if (modPlayer.playFullAdrenalineBurnoutSound)
|
||||
{
|
||||
modPlayer.playFullAdrenalineBurnoutSound = false;
|
||||
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/AdrenalineBurnout2"), (int)player.position.X, (int)player.position.Y);
|
||||
}
|
||||
modPlayer.adrenalineDmgDown = 0;
|
||||
}
|
||||
modPlayer.adrenalineMaxTimer = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Reset Adrenaline burnout variables
|
||||
else if (!modPlayer.adrenalineMode && modPlayer.adrenaline <= 0)
|
||||
{
|
||||
modPlayer.playAdrenalineBurnoutSound = true;
|
||||
modPlayer.playFullAdrenalineBurnoutSound = true;
|
||||
modPlayer.adrenalineDmgDown = 600;
|
||||
modPlayer.adrenalineMaxTimer = 300;
|
||||
modPlayer.adrenalineDmgMult = 1f;
|
||||
}
|
||||
|
||||
// Reduce Adrenaline Mode damage based on burnout
|
||||
modPlayer.adrenalineDmgMult = 0.1f * (float)(modPlayer.adrenalineDmgDown / 60);
|
||||
if (modPlayer.adrenalineDmgMult < 0.33f)
|
||||
modPlayer.adrenalineDmgMult = 0.33f;
|
||||
|
||||
// Amount of Adrenaline gained per 'tick'
|
||||
int adrenalineGain = 0;
|
||||
bool SCalAlive = NPC.AnyNPCs(ModContent.NPCType<SupremeCalamitas>());
|
||||
@@ -486,6 +445,8 @@ namespace CalamityMod.CalPlayer
|
||||
modPlayer.plaguedFuelPackCooldown--;
|
||||
if (modPlayer.plaguedFuelPackDash > 0)
|
||||
modPlayer.plaguedFuelPackDash--;
|
||||
if (modPlayer.jellyDmg > 0f)
|
||||
modPlayer.jellyDmg -= 1f;
|
||||
if (modPlayer.ataxiaDmg > 0f)
|
||||
modPlayer.ataxiaDmg -= 1.5f;
|
||||
if (modPlayer.ataxiaDmg < 0f)
|
||||
@@ -2806,6 +2767,15 @@ namespace CalamityMod.CalPlayer
|
||||
modPlayer.critStats[1] = player.rangedCrit;
|
||||
modPlayer.critStats[2] = player.magicCrit;
|
||||
modPlayer.critStats[3] = modPlayer.throwingCrit;
|
||||
modPlayer.ammoReductionRanged = (int)(100f *
|
||||
(player.ammoBox ? 0.8f : 1f) *
|
||||
(player.ammoPotion ? 0.8f : 1f) *
|
||||
(player.ammoCost80 ? 0.8f : 1f) *
|
||||
(player.ammoCost75 ? 0.75f : 1f));
|
||||
modPlayer.ammoReductionRogue = (int)(100f *
|
||||
(modPlayer.throwingAmmoCost75 ? 0.75f : 1f) *
|
||||
(modPlayer.throwingAmmoCost66 ? 0.66f : 1f) *
|
||||
(modPlayer.throwingAmmoCost50 ? 0.5f : 1f));
|
||||
modPlayer.defenseStat = player.statDefense;
|
||||
modPlayer.DRStat = (int)(player.endurance * 100f);
|
||||
modPlayer.meleeSpeedStat = (int)((1f - player.meleeSpeed) * (100f / player.meleeSpeed));
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
public class JellyChargedBattery : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Jelly-Charged Battery");
|
||||
Tooltip.SetDefault("+1 max minions and 10% minion damage\n" +
|
||||
"Minion attacks spawn orbs of energy and inflict Electrified");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 20;
|
||||
item.height = 22;
|
||||
item.value = Item.buyPrice(0, 2, 0, 0);
|
||||
item.accessory = true;
|
||||
item.rare = 2;
|
||||
}
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
player.Calamity().voltaicJelly = true;
|
||||
player.Calamity().jellyChargedBattery = true;
|
||||
player.maxMinions ++;
|
||||
player.minionDamage += 0.1f;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ModContent.ItemType<WulfrumBattery>());
|
||||
recipe.AddIngredient(ModContent.ItemType<VoltaicJelly>());
|
||||
recipe.AddTile(TileID.TinkerersWorkbench);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 522 B |
@@ -31,6 +31,8 @@ namespace CalamityMod.Items.Accessories
|
||||
int manaCost = modPlayer.manaCostStat;
|
||||
int rogueVelocity = modPlayer.rogueVelocityStat;
|
||||
int minionSlots = modPlayer.minionSlotStat;
|
||||
int ammoConsumption = modPlayer.ammoReductionRanged;
|
||||
int rogueConsumption = modPlayer.ammoReductionRogue;
|
||||
int lifeRegen = modPlayer.lifeRegenStat;
|
||||
int manaRegen = modPlayer.manaRegenStat;
|
||||
int armorPenetration = modPlayer.armorPenetrationStat;
|
||||
@@ -52,11 +54,12 @@ namespace CalamityMod.Items.Accessories
|
||||
"Melee Damage: " + modPlayer.damageStats[0] + "% | Melee Crit Chance: " + modPlayer.critStats[0] + "%\n" +
|
||||
"Melee Speed Boost: " + meleeSpeed + "%\n\n" +
|
||||
"Ranged Damage: " + modPlayer.damageStats[1] + "% | Ranged Crit Chance: " + modPlayer.critStats[1] + "%\n\n" +
|
||||
"Ammo Consumption Chance: " + modPlayer.ammoReductionRanged + "%\n" +
|
||||
"Magic Damage: " + modPlayer.damageStats[2] + "% | Magic Crit Chance: " + modPlayer.critStats[2] + "%\n" +
|
||||
"Mana Usage: " + manaCost + "% | Mana Regen: " + manaRegen + "\n\n" +
|
||||
"Minion Damage: " + modPlayer.damageStats[3] + "% | Minion Slots: " + minionSlots + "\n\n" +
|
||||
"Rogue Damage: " + modPlayer.damageStats[4] + "% | Rogue Crit Chance: " + modPlayer.critStats[3] + "%\n" +
|
||||
"Rogue Velocity Boost: " + rogueVelocity + "%\n\n" +
|
||||
"Rogue Velocity Boost: " + rogueVelocity + "% | Rogue Weapon Consumption Chance: " + modPlayer.ammoReductionRogue + "%\n\n" +
|
||||
"Defense: " + defense + " | DR: " + DR + "%\n" +
|
||||
"Life Regen: " + lifeRegen + " | Armor Penetration: " + armorPenetration + "\n" +
|
||||
"Wing Flight Time: " + wingFlightTime + " | Movement Speed Boost: " + moveSpeed + "%\n\n" +
|
||||
@@ -81,11 +84,12 @@ namespace CalamityMod.Items.Accessories
|
||||
line2.text = "Melee Damage: " + modPlayer.damageStats[0] + "% | Melee Crit Chance: " + modPlayer.critStats[0] + "%\n" +
|
||||
"Melee Speed Boost: " + meleeSpeed + "%\n\n" +
|
||||
"Ranged Damage: " + modPlayer.damageStats[1] + "% | Ranged Crit Chance: " + modPlayer.critStats[1] + "%\n\n" +
|
||||
"Ammo Consumption Chance: " + modPlayer.ammoReductionRanged + "%\n" +
|
||||
"Magic Damage: " + modPlayer.damageStats[2] + "% | Magic Crit Chance: " + modPlayer.critStats[2] + "%\n" +
|
||||
"Mana Usage: " + manaCost + "% | Mana Regen: " + manaRegen + "\n\n" +
|
||||
"Minion Damage: " + modPlayer.damageStats[3] + "% | Minion Slots: " + minionSlots + "\n\n" +
|
||||
"Rogue Damage: " + modPlayer.damageStats[4] + "% | Rogue Crit Chance: " + modPlayer.critStats[3] + "%\n" +
|
||||
"Rogue Velocity Boost: " + rogueVelocity + "%\n\n" +
|
||||
"Rogue Velocity Boost: " + rogueVelocity + "% | Rogue Weapon Consumption Chance: " + modPlayer.ammoReductionRogue + "%\n\n" +
|
||||
"Defense: " + defense + " | DR: " + DR + "%\n" +
|
||||
"Life Regen: " + lifeRegen + " | Armor Penetration: " + armorPenetration + "\n" +
|
||||
"Wing Flight Time: " + wingFlightTime + " | Movement Speed Boost: " + moveSpeed + "%\n\n" +
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
public class VoltaicJelly : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Voltaic Jelly");
|
||||
Tooltip.SetDefault("+1 max minions\n" +
|
||||
"Minion attacks inflict Electrified");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 20;
|
||||
item.height = 22;
|
||||
item.value = Item.buyPrice(0, 2, 0, 0);
|
||||
item.accessory = true;
|
||||
item.rare = 2;
|
||||
}
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
player.Calamity().voltaicJelly = true;
|
||||
player.maxMinions ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 345 B |
@@ -0,0 +1,29 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
public class WulfrumBattery : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Wulfrum Battery");
|
||||
Tooltip.SetDefault("7% increased summon damage");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 20;
|
||||
item.height = 22;
|
||||
item.value = Item.buyPrice(0, 1, 0, 0);
|
||||
item.accessory = true;
|
||||
item.rare = 1;
|
||||
}
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
player.minionDamage += 0.07f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 371 B |
@@ -12,7 +12,7 @@ namespace CalamityMod.Items.Armor
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Statigel Mask");
|
||||
Tooltip.SetDefault("10% increased rogue damage and 33% chance to not consume rogue items\n" +
|
||||
Tooltip.SetDefault("10% increased rogue damage and 34% chance to not consume rogue items\n" +
|
||||
"7% increased rogue critical strike chance and 12% increased movement speed");
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace CalamityMod.Items.Armor
|
||||
item.width = 18;
|
||||
item.height = 18;
|
||||
item.value = Item.buyPrice(0, 24, 0, 0);
|
||||
item.rare = 9;
|
||||
item.rare = 10;
|
||||
item.defense = 24;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace CalamityMod.Items.Armor
|
||||
item.width = 18;
|
||||
item.height = 18;
|
||||
item.value = Item.buyPrice(0, 40, 0, 0);
|
||||
item.rare = 9;
|
||||
item.rare = 10;
|
||||
item.defense = 20; //71
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace CalamityMod.Items.Armor
|
||||
item.width = 18;
|
||||
item.height = 18;
|
||||
item.value = Item.buyPrice(0, 32, 0, 0);
|
||||
item.rare = 9;
|
||||
item.rare = 10;
|
||||
item.defense = 27;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -36,10 +37,30 @@ Too dry for my taste");
|
||||
return player.FindBuffIndex(BuffID.PotionSickness) == -1;
|
||||
}
|
||||
|
||||
public override bool UseItem(Player player)
|
||||
public override void OnConsumeItem(Player player)
|
||||
{
|
||||
player.statLife += (player.Calamity().baguette ? 250 : 200);
|
||||
if (player.statLife > player.statLifeMax2)
|
||||
{
|
||||
player.statLife = player.statLifeMax2;
|
||||
}
|
||||
if (Main.myPlayer == player.whoAmI)
|
||||
{
|
||||
player.HealEffect((player.Calamity().baguette ? 250 : 200), true);
|
||||
}
|
||||
player.AddBuff(ModContent.BuffType<RedWineBuff>(), 900);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Zeroes out the hardcoded healing function from having a healLife value. The item still heals in the UseItem hook.
|
||||
public override void GetHealLife(Player player, bool quickHeal, ref int healValue)
|
||||
{
|
||||
healValue = 0;
|
||||
}
|
||||
|
||||
// Forces the "Restores X life" tooltip to display the actual life restored instead of zero (due to the previous function).
|
||||
public override void ModifyTooltips(List<TooltipLine> tooltips)
|
||||
{
|
||||
tooltips.Find(line => line.Name == "HealLife").text = "Restores " + item.healLife + " life";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Buffs.Potions;
|
||||
|
||||
namespace CalamityMod.Items.Potions
|
||||
{
|
||||
public class Baguette : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Baguette");
|
||||
Tooltip.SetDefault("Minor improvements to all stats for 20 minutes\n" +
|
||||
"Boosts the effects of Red Wine\n" +
|
||||
"[c/FCE391:je suis Monte]");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 26;
|
||||
item.height = 26;
|
||||
item.useTurn = true;
|
||||
item.maxStack = 30;
|
||||
item.useAnimation = 17;
|
||||
item.useTime = 17;
|
||||
item.rare = 1;
|
||||
item.useStyle = 2;
|
||||
item.UseSound = SoundID.Item2;
|
||||
item.consumable = true;
|
||||
item.value = Item.buyPrice(0, 0, 50, 0);
|
||||
item.buffType = ModContent.BuffType<BaguetteBuff>();
|
||||
item.buffTime = 18000;
|
||||
item.Calamity().postMoonLordRarity = 21;
|
||||
}
|
||||
|
||||
public override void OnConsumeItem(Player player)
|
||||
{
|
||||
player.AddBuff(BuffID.WellFed, 72000);
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ItemID.Hay, 10);
|
||||
recipe.AddTile(TileID.Furnaces);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 640 B |
@@ -0,0 +1,86 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Weapons.Rogue;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
public class AcesHigh : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Ace's High");
|
||||
Tooltip.SetDefault("Fires a string of cards with varying effects based on card type\n" +
|
||||
"Hearts grant lifesteal. Spades pierce and ignore immunity frames.\n" +
|
||||
"Diamonds explode. Clubs split into three.");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.damage = 999;
|
||||
item.ranged = true;
|
||||
item.width = 48;
|
||||
item.height = 30;
|
||||
item.useTime = 3;
|
||||
item.reuseDelay = 8;
|
||||
item.useAnimation = 12;
|
||||
item.useStyle = 5;
|
||||
item.noMelee = true;
|
||||
item.knockBack = 6f;
|
||||
item.value = Item.buyPrice(2, 50, 0, 0);
|
||||
item.rare = 10;
|
||||
item.UseSound = SoundID.Item36;
|
||||
item.autoReuse = true;
|
||||
item.shootSpeed = 24f;
|
||||
item.shoot = ModContent.ProjectileType<CardHeart>();
|
||||
item.useAmmo = 97;
|
||||
item.Calamity().postMoonLordRarity = 21;
|
||||
}
|
||||
|
||||
public override Vector2? HoldoutOffset()
|
||||
{
|
||||
return new Vector2(-5, 0);
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ModContent.ItemType<ClaretCannon>());
|
||||
recipe.AddIngredient(ModContent.ItemType<Spyker>());
|
||||
recipe.AddIngredient(ModContent.ItemType<Fungicide>());
|
||||
recipe.AddIngredient(ModContent.ItemType<FantasyTalisman>(), 52);
|
||||
recipe.AddIngredient(ModContent.ItemType<HellcasterFragment>(), 6);
|
||||
recipe.AddTile(ModContent.TileType<DraedonsForge>());
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
int card = ModContent.ProjectileType<CardHeart>();
|
||||
switch (Main.rand.Next(4))
|
||||
{
|
||||
case 0:
|
||||
card = ModContent.ProjectileType<CardHeart>();
|
||||
break;
|
||||
case 1:
|
||||
card = ModContent.ProjectileType<CardSpade>();
|
||||
break;
|
||||
case 2:
|
||||
card = ModContent.ProjectileType<CardDiamond>();
|
||||
break;
|
||||
case 3:
|
||||
card = ModContent.ProjectileType<CardClub>();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, card, damage, knockBack, player.whoAmI, 0.0f, 0.0f);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 591 B |
@@ -39,7 +39,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
|
||||
public override Vector2? HoldoutOffset()
|
||||
{
|
||||
return new Vector2(0, -5);
|
||||
return new Vector2(-5, 0);
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.damage = 1301;
|
||||
item.damage = 1401;
|
||||
item.ranged = true;
|
||||
item.width = 84;
|
||||
item.height = 30;
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
public class Hypothermia : RogueWeapon
|
||||
{
|
||||
private int counter = 0;
|
||||
private bool justStealthStriked = false;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Hypothermia");
|
||||
Tooltip.SetDefault("Fires a constant barrage of black ice shards\n" +
|
||||
"Stealth strikes launch a chain short ranged ice chunks that shatter into ice shards");
|
||||
}
|
||||
|
||||
public override void SafeSetDefaults()
|
||||
{
|
||||
item.width = 46;
|
||||
item.height = 32;
|
||||
item.autoReuse = true;
|
||||
item.noUseGraphic = true;
|
||||
item.noMelee = true;
|
||||
item.useStyle = ItemUseStyleID.SwingThrow;
|
||||
item.UseSound = SoundID.Item9;
|
||||
item.value = Item.buyPrice(1, 80, 0, 0);
|
||||
item.rare = 10;
|
||||
|
||||
item.damage = 549;
|
||||
item.useAnimation = 21;
|
||||
item.useTime = 3;
|
||||
item.crit = 16;
|
||||
item.knockBack = 3f;
|
||||
item.shoot = ModContent.ProjectileType<HypothermiaShard>();
|
||||
item.shootSpeed = 8f;
|
||||
|
||||
item.Calamity().postMoonLordRarity = 14;
|
||||
item.Calamity().rogue = 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)
|
||||
{
|
||||
counter++;
|
||||
if (counter >= 7)
|
||||
counter = 0;
|
||||
|
||||
if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike
|
||||
{
|
||||
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType<HypothermiaChunk>(), damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
justStealthStriked = true;
|
||||
return false;
|
||||
}
|
||||
if (justStealthStriked == true) //this is Ben, no I don't know how what I did translates to what happened in game but we're rolling with it
|
||||
{
|
||||
if (counter == 1 || counter == 2 || counter == 3 || counter == 4 || counter == 5 || counter == 6)
|
||||
{
|
||||
if (counter == 6)
|
||||
{
|
||||
justStealthStriked = false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int num6 = Main.rand.Next(1, 3);
|
||||
for (int index = 0; index < num6; ++index)
|
||||
{
|
||||
float SpeedX = speedX + (float)Main.rand.Next(-40, 41) * 0.05f;
|
||||
float SpeedY = speedY + (float)Main.rand.Next(-40, 41) * 0.05f;
|
||||
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0.0f, 0.0f);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ModContent.ItemType<CosmiliteBar>(), 6);
|
||||
recipe.AddIngredient(ModContent.ItemType<EndothermicEnergy>(), 24);
|
||||
recipe.AddIngredient(ModContent.ItemType<RuinousSoul>(), 6);
|
||||
recipe.AddTile(ModContent.TileType<DraedonsForge>());
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 706 B |
@@ -31,6 +31,7 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
crit = item.crit + player.Calamity().throwingCrit;
|
||||
}
|
||||
|
||||
public override float UseTimeMultiplier(Player player)
|
||||
{
|
||||
float rogueAS = 1f;
|
||||
|
||||
@@ -21,7 +21,7 @@ Stealth strikes release energy as they fly");
|
||||
public override void SafeSetDefaults()
|
||||
{
|
||||
item.width = 34;
|
||||
item.damage = 1299;
|
||||
item.damage = 1349;
|
||||
item.noMelee = true;
|
||||
item.noUseGraphic = true;
|
||||
item.useAnimation = 24;
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace CalamityMod.Items.Weapons.Summon
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Lantern of the Soul");
|
||||
DisplayName.SetDefault("Guidelight of Oblivion");
|
||||
Tooltip.SetDefault("Summons a lantern turret to fight for you");
|
||||
}
|
||||
|
||||
|
||||
@@ -128,14 +128,17 @@ namespace CalamityMod.Items.Weapons.Summon
|
||||
vector2.X = (float)Main.mouseX + Main.screenPosition.X;
|
||||
vector2.Y = (float)Main.mouseY + Main.screenPosition.Y;
|
||||
int curr = Projectile.NewProjectile(vector2.X, vector2.Y, velX, velY, ModContent.ProjectileType<MechwormHead>(), damage, knockBack, owner);
|
||||
int head2 = curr;
|
||||
|
||||
int prev = curr;
|
||||
curr = Projectile.NewProjectile(vector2.X, vector2.Y, velX, velY, ModContent.ProjectileType<MechwormBody>(), damage, knockBack, owner, (float)prev);
|
||||
Main.projectile[curr].identity = head2;
|
||||
|
||||
prev = curr;
|
||||
curr = Projectile.NewProjectile(vector2.X, vector2.Y, velX, velY, ModContent.ProjectileType<MechwormBody2>(), damage, knockBack, owner, (float)prev);
|
||||
Main.projectile[prev].localAI[1] = (float)curr;
|
||||
Main.projectile[prev].netUpdate = true;
|
||||
Main.projectile[curr].identity = head2;
|
||||
|
||||
prev = curr;
|
||||
curr = Projectile.NewProjectile(vector2.X, vector2.Y, velX, velY, ModContent.ProjectileType<MechwormTail>(), damage, knockBack, owner, (float)prev);
|
||||
@@ -144,18 +147,21 @@ namespace CalamityMod.Items.Weapons.Summon
|
||||
}
|
||||
else if (head != -1 && tail != -1)
|
||||
{
|
||||
int body = Projectile.NewProjectile(vector2.X, vector2.Y, velX, velY, ModContent.ProjectileType<MechwormBody>(), damage, knockBack, owner, Main.projectile[tail].ai[0]);
|
||||
float uuid = (float)Projectile.GetByUUID(Main.myPlayer, Main.projectile[tail].ai[0]);
|
||||
int body = Projectile.NewProjectile(vector2.X, vector2.Y, velX, velY, ModContent.ProjectileType<MechwormBody>(), damage, knockBack, owner, uuid);
|
||||
int back = Projectile.NewProjectile(vector2.X, vector2.Y, velX, velY, ModContent.ProjectileType<MechwormBody2>(), damage, knockBack, owner, (float)body);
|
||||
|
||||
Main.projectile[body].localAI[1] = (float)back;
|
||||
Main.projectile[body].ai[1] = 1f;
|
||||
Main.projectile[body].netUpdate = true;
|
||||
Main.projectile[body].identity = head;
|
||||
|
||||
Main.projectile[back].localAI[1] = (float)tail;
|
||||
Main.projectile[back].netUpdate = true;
|
||||
Main.projectile[back].ai[1] = 1f;
|
||||
Main.projectile[body].identity = head;
|
||||
|
||||
Main.projectile[tail].ai[0] = (float)back;
|
||||
Main.projectile[tail].ai[0] = Main.projectile[body].projUUID;
|
||||
Main.projectile[tail].netUpdate = true;
|
||||
Main.projectile[tail].ai[1] = 1f;
|
||||
}
|
||||
|
||||
@@ -24,6 +24,8 @@ namespace CalamityMod.NPCs
|
||||
public static void AquaticScourgeAI(NPC npc, Mod mod, bool head)
|
||||
{
|
||||
CalamityGlobalNPC calamityGlobalNPC = npc.Calamity();
|
||||
bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive;
|
||||
bool death = CalamityWorld.death || CalamityWorld.bossRushActive;
|
||||
|
||||
// Adjust hostility and stats
|
||||
if (npc.justHit || (double)npc.life <= (double)npc.lifeMax * 0.99 || CalamityWorld.bossRushActive ||
|
||||
@@ -52,7 +54,7 @@ namespace CalamityMod.NPCs
|
||||
|
||||
// Circular movement
|
||||
bool doSpiral = false;
|
||||
if (head && calamityGlobalNPC.newAI[0] == 1f && calamityGlobalNPC.newAI[2] == 1f && (CalamityWorld.revenge || CalamityWorld.bossRushActive))
|
||||
if (head && calamityGlobalNPC.newAI[0] == 1f && calamityGlobalNPC.newAI[2] == 1f && revenge)
|
||||
{
|
||||
float ai3 = 600f;
|
||||
calamityGlobalNPC.newAI[3] += 1f;
|
||||
@@ -151,7 +153,7 @@ namespace CalamityMod.NPCs
|
||||
if (Main.player[npc.target].gravDir == -1f)
|
||||
npc.localAI[0] += 2f;
|
||||
|
||||
if (npc.localAI[0] >= (CalamityWorld.bossRushActive ? 300f : (CalamityWorld.revenge ? 360f : 420f)))
|
||||
if (npc.localAI[0] >= (CalamityWorld.bossRushActive ? 300f : (revenge ? 360f : 420f)))
|
||||
{
|
||||
int npcPosX = (int)(npc.position.X + (float)(npc.width / 2)) / 16;
|
||||
int npcPosY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16;
|
||||
@@ -181,7 +183,7 @@ namespace CalamityMod.NPCs
|
||||
double offsetAngleBoom;
|
||||
int iBoom;
|
||||
int damageBoom = Main.expertMode ? 23 : 28;
|
||||
float velocity = CalamityWorld.revenge ? 7.5f : 6.5f;
|
||||
float velocity = revenge ? 7.5f : 6.5f;
|
||||
if (CalamityWorld.bossRushActive)
|
||||
velocity = 11f;
|
||||
|
||||
@@ -382,7 +384,7 @@ namespace CalamityMod.NPCs
|
||||
|
||||
if (calamityGlobalNPC.newAI[0] == 1f)
|
||||
{
|
||||
num188 = CalamityWorld.revenge ? 15f : 13f;
|
||||
num188 = revenge ? 15f : 13f;
|
||||
num189 = 0.16f;
|
||||
if (notOcean)
|
||||
{
|
||||
@@ -597,6 +599,7 @@ namespace CalamityMod.NPCs
|
||||
bool provy = CalamityWorld.downedProvidence && !CalamityWorld.bossRushActive;
|
||||
bool expertMode = Main.expertMode || CalamityWorld.bossRushActive;
|
||||
bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive;
|
||||
bool death = CalamityWorld.death || CalamityWorld.bossRushActive;
|
||||
bool calamity = modPlayer.ZoneCalamity;
|
||||
|
||||
// Reset defense
|
||||
@@ -640,11 +643,12 @@ namespace CalamityMod.NPCs
|
||||
speed = 12f;
|
||||
else if (!calamity)
|
||||
speed = 7f;
|
||||
else if (CalamityWorld.death)
|
||||
else if (death)
|
||||
speed = 6f;
|
||||
else if (revenge)
|
||||
speed = 5.5f;
|
||||
speed += 2f * (1f - lifeRatio);
|
||||
float speedBoost = death ? 2f : 2f * (1f - lifeRatio);
|
||||
speed += speedBoost;
|
||||
|
||||
// Variables for target location relative to npc location
|
||||
float xDistance = player.Center.X - vectorCenter.X;
|
||||
@@ -779,7 +783,7 @@ namespace CalamityMod.NPCs
|
||||
if (npc.ai[1] % 30f == 29f)
|
||||
shootProjectile = true;
|
||||
}
|
||||
else if (lifeRatio < 0.5f || CalamityWorld.death)
|
||||
else if (lifeRatio < 0.5f || death)
|
||||
{
|
||||
if (npc.ai[1] % 35f == 34f)
|
||||
shootProjectile = true;
|
||||
@@ -798,7 +802,8 @@ namespace CalamityMod.NPCs
|
||||
projectileSpeed += 1f;
|
||||
if (!calamity)
|
||||
projectileSpeed += 2f;
|
||||
projectileSpeed += 3f * (1f - lifeRatio);
|
||||
float projectileSpeedBoost = death ? 3f : 3f * (1f - lifeRatio);
|
||||
projectileSpeed += projectileSpeedBoost;
|
||||
|
||||
float num742 = CalamityWorld.bossRushActive ? 6f : 4f;
|
||||
float num743 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vectorCenter.X;
|
||||
@@ -900,10 +905,11 @@ namespace CalamityMod.NPCs
|
||||
npc.chaseable = false;
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
npc.localAI[0] += 1f + 2f * (1f - lifeRatio);
|
||||
float shootBoost = death ? 2f : 2f * (1f - lifeRatio);
|
||||
npc.localAI[0] += 1f + shootBoost;
|
||||
if (calamityGlobalNPC.enraged > 0 || (Config.BossRushXerocCurse && CalamityWorld.bossRushActive))
|
||||
npc.localAI[0] += 2f;
|
||||
if (CalamityWorld.death || !calamity)
|
||||
if (death || !calamity)
|
||||
npc.localAI[0] += 1f;
|
||||
|
||||
if (npc.localAI[0] >= 120f)
|
||||
@@ -1010,6 +1016,7 @@ namespace CalamityMod.NPCs
|
||||
}
|
||||
|
||||
// Variables for increasing difficulty
|
||||
bool death = CalamityWorld.death || CalamityWorld.bossRushActive;
|
||||
bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive;
|
||||
bool expertMode = Main.expertMode || CalamityWorld.bossRushActive;
|
||||
bool dayTime = Main.dayTime && !CalamityWorld.bossRushActive;
|
||||
@@ -1242,11 +1249,10 @@ namespace CalamityMod.NPCs
|
||||
{
|
||||
if (!brotherAlive)
|
||||
{
|
||||
npc.localAI[1] += 1f * (1f - lifeRatio);
|
||||
float shootBoost = death ? 1f : 1f * (1f - lifeRatio);
|
||||
npc.localAI[1] += shootBoost;
|
||||
if (revenge)
|
||||
npc.localAI[1] += 0.5f;
|
||||
if (CalamityWorld.death || CalamityWorld.bossRushActive)
|
||||
npc.localAI[1] += 0.5f;
|
||||
}
|
||||
|
||||
if (npc.localAI[1] > 180f)
|
||||
@@ -1368,8 +1374,6 @@ namespace CalamityMod.NPCs
|
||||
{
|
||||
if (revenge)
|
||||
npc.localAI[1] += 0.5f;
|
||||
if (CalamityWorld.death || CalamityWorld.bossRushActive)
|
||||
npc.localAI[1] += 0.5f;
|
||||
if (calamityGlobalNPC.enraged > 0 || (Config.BossRushXerocCurse && CalamityWorld.bossRushActive))
|
||||
npc.localAI[1] += 0.5f;
|
||||
if (expertMode)
|
||||
@@ -1948,21 +1952,22 @@ namespace CalamityMod.NPCs
|
||||
// Percent life remaining
|
||||
float lifeRatio = (float)npc.life / (float)npc.lifeMax;
|
||||
|
||||
// Phases
|
||||
bool phase2 = lifeRatio < 0.75f || CalamityWorld.bossRushActive;
|
||||
bool phase3 = lifeRatio < 0.5f || CalamityWorld.bossRushActive;
|
||||
|
||||
// Variables
|
||||
bool expertMode = Main.expertMode || CalamityWorld.bossRushActive;
|
||||
bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive;
|
||||
int shootBuff = (int)(2f * (1f - lifeRatio));
|
||||
bool death = CalamityWorld.death || CalamityWorld.bossRushActive;
|
||||
int shootBuff = death ? 1 : (int)(2f * (1f - lifeRatio));
|
||||
float shootTimer = 1f + ((float)shootBuff);
|
||||
bool dayTime = Main.dayTime;
|
||||
Player player = Main.player[npc.target];
|
||||
npc.spriteDirection = (npc.direction > 0) ? 1 : -1;
|
||||
|
||||
// Despawn
|
||||
if (!player.active || player.dead || dayTime)
|
||||
// Phases
|
||||
bool phase2 = lifeRatio < 0.75f || death;
|
||||
bool phase3 = lifeRatio < 0.5f || death;
|
||||
|
||||
// Despawn
|
||||
if (!player.active || player.dead || dayTime)
|
||||
{
|
||||
npc.TargetClosest(false);
|
||||
player = Main.player[npc.target];
|
||||
@@ -2102,8 +2107,9 @@ namespace CalamityMod.NPCs
|
||||
// Walk
|
||||
else if (npc.ai[0] == 2f)
|
||||
{
|
||||
// Set walking speed
|
||||
float num823 = (CalamityWorld.bossRushActive ? 8f : 5f) + (3f * (1f - lifeRatio));
|
||||
// Set walking speed
|
||||
float speedBoost = death ? 3f : 3f * (1f - lifeRatio);
|
||||
float num823 = (CalamityWorld.bossRushActive ? 8f : 5f) + speedBoost;
|
||||
|
||||
// Set walking direction
|
||||
if (Math.Abs(npc.Center.X - player.Center.X) < 200f)
|
||||
@@ -2195,7 +2201,8 @@ namespace CalamityMod.NPCs
|
||||
// Set jump velocity, reset and set AI to next phase (Stomp)
|
||||
npc.TargetClosest(true);
|
||||
|
||||
float velocityX = (CalamityWorld.bossRushActive ? 9f : 6f) + (6f * (1f - lifeRatio));
|
||||
float velocityBoost = death ? 6f : 6f * (1f - lifeRatio);
|
||||
float velocityX = (CalamityWorld.bossRushActive ? 9f : 6f) + velocityBoost;
|
||||
npc.velocity.X = velocityX * (float)npc.direction;
|
||||
|
||||
if (revenge)
|
||||
@@ -2261,7 +2268,8 @@ namespace CalamityMod.NPCs
|
||||
|
||||
if (player.position.Y > npc.position.Y + (float)npc.height)
|
||||
{
|
||||
float fallSpeed = 0.8f + (0.8f * (1f - lifeRatio));
|
||||
float fallSpeedBoost = death ? 0.8f : 0.8f * (1f - lifeRatio);
|
||||
float fallSpeed = 0.8f + fallSpeedBoost;
|
||||
npc.velocity.Y += fallSpeed;
|
||||
}
|
||||
}
|
||||
@@ -2272,7 +2280,8 @@ namespace CalamityMod.NPCs
|
||||
else if (npc.direction > 0)
|
||||
npc.velocity.X += 0.2f;
|
||||
|
||||
float num626 = (CalamityWorld.bossRushActive ? 12f : 9f) + (6f * (1f - lifeRatio));
|
||||
float velocityBoost = death ? 6f : 6f * (1f - lifeRatio);
|
||||
float num626 = (CalamityWorld.bossRushActive ? 12f : 9f) + velocityBoost;
|
||||
if (npc.velocity.X < -num626)
|
||||
npc.velocity.X = -num626;
|
||||
if (npc.velocity.X > num626)
|
||||
@@ -2429,6 +2438,7 @@ namespace CalamityMod.NPCs
|
||||
// Difficulty variables
|
||||
bool expertMode = Main.expertMode || CalamityWorld.bossRushActive;
|
||||
bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive;
|
||||
bool death = CalamityWorld.death || CalamityWorld.bossRushActive;
|
||||
|
||||
// Emit light
|
||||
Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0.2f, 0.05f, 0.2f);
|
||||
@@ -2599,11 +2609,6 @@ namespace CalamityMod.NPCs
|
||||
// Speed and turn speed
|
||||
float speedLimit = revenge ? 7f : 6f;
|
||||
float turnSpeedLimit = revenge ? 0.11f : 0.1f;
|
||||
if (CalamityWorld.death || CalamityWorld.bossRushActive)
|
||||
{
|
||||
speedLimit = 8f;
|
||||
turnSpeedLimit = 0.12f;
|
||||
}
|
||||
if (CalamityWorld.bossRushActive)
|
||||
{
|
||||
speedLimit *= 1.5f;
|
||||
@@ -2611,8 +2616,8 @@ namespace CalamityMod.NPCs
|
||||
}
|
||||
|
||||
// Speed and turn speed boosts based on remaining HP
|
||||
float speedBoost = speedLimit * (1f - (float)mainDeusHPRatio);
|
||||
float turnSpeedBoost = turnSpeedLimit * (1f - (float)mainDeusHPRatio);
|
||||
float speedBoost = death ? speedLimit : speedLimit * (1f - (float)mainDeusHPRatio);
|
||||
float turnSpeedBoost = death ? turnSpeedLimit : turnSpeedLimit * (1f - (float)mainDeusHPRatio);
|
||||
if (Main.player[npc.target].gravDir == -1f)
|
||||
{
|
||||
speedBoost = speedLimit;
|
||||
@@ -2778,13 +2783,13 @@ namespace CalamityMod.NPCs
|
||||
if (npc.type == ModContent.NPCType<AstrumDeusBodySpectral>() && Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
int shootTime = 4;
|
||||
if ((double)npc.life <= (double)npc.lifeMax * 0.65 || CalamityWorld.bossRushActive || Main.player[npc.target].gravDir == -1f)
|
||||
if ((double)npc.life <= (double)npc.lifeMax * 0.65 || death || Main.player[npc.target].gravDir == -1f)
|
||||
{
|
||||
shootTime += CalamityWorld.death ? 4 : 2;
|
||||
shootTime += death ? 4 : 2;
|
||||
}
|
||||
if ((double)npc.life <= (double)npc.lifeMax * 0.3 || CalamityWorld.bossRushActive || Main.player[npc.target].gravDir == -1f)
|
||||
if ((double)npc.life <= (double)npc.lifeMax * 0.3 || death || Main.player[npc.target].gravDir == -1f)
|
||||
{
|
||||
shootTime += CalamityWorld.death ? 6 : 2;
|
||||
shootTime += death ? 6 : 2;
|
||||
}
|
||||
npc.localAI[0] += (float)Main.rand.Next(shootTime);
|
||||
if (npc.localAI[0] >= (float)Main.rand.Next(1400, 20000))
|
||||
@@ -2794,14 +2799,14 @@ namespace CalamityMod.NPCs
|
||||
if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height))
|
||||
{
|
||||
float num941 = revenge ? 14f : 13f;
|
||||
if (CalamityWorld.death)
|
||||
{
|
||||
num941 = 16f;
|
||||
}
|
||||
if (CalamityWorld.bossRushActive)
|
||||
{
|
||||
num941 = 24f;
|
||||
}
|
||||
else if (death)
|
||||
{
|
||||
num941 = 16f;
|
||||
}
|
||||
if (Main.player[npc.target].gravDir == -1f)
|
||||
{
|
||||
num941 *= 2f;
|
||||
@@ -2885,8 +2890,8 @@ namespace CalamityMod.NPCs
|
||||
if (head)
|
||||
{
|
||||
// Spawn mine probes
|
||||
float firstProbeSpawnThreshold = ((CalamityWorld.death || CalamityWorld.bossRushActive) ? 0.9f : 0.66f);
|
||||
float secondProbeSpawnThreshold = ((CalamityWorld.death || CalamityWorld.bossRushActive) ? 0.8f : 0.33f);
|
||||
float firstProbeSpawnThreshold = death ? 0.9f : 0.66f;
|
||||
float secondProbeSpawnThreshold = death ? 0.8f : 0.33f;
|
||||
|
||||
if (deusHPRatio <= firstProbeSpawnThreshold)
|
||||
{
|
||||
@@ -2922,13 +2927,10 @@ namespace CalamityMod.NPCs
|
||||
// Velocity variables
|
||||
float speedAdd = expertMode ? 0.06f : 0.045f;
|
||||
float turnSpeedAdd = expertMode ? 0.04f : 0.03f;
|
||||
if (CalamityWorld.death || CalamityWorld.bossRushActive)
|
||||
{
|
||||
speedAdd *= 1.25f;
|
||||
turnSpeedAdd *= 1.25f;
|
||||
}
|
||||
float newSpeed = 0.12f + speedAdd * (1f - deusHPRatio);
|
||||
float newTurnSpeed = 0.08f + turnSpeedAdd * (1f - deusHPRatio);
|
||||
float newSpeedBoost = death ? speedAdd : speedAdd * (1f - deusHPRatio);
|
||||
float newTurnSpeedBoost = death ? turnSpeedAdd : turnSpeedAdd * (1f - deusHPRatio);
|
||||
float newSpeed = 0.12f + newSpeedBoost;
|
||||
float newTurnSpeed = 0.08f + newTurnSpeedBoost;
|
||||
|
||||
// Movement variables
|
||||
int num180 = (int)(npc.position.X / 16f) - 1;
|
||||
@@ -3186,6 +3188,7 @@ namespace CalamityMod.NPCs
|
||||
int lifePercentage = (int)(100.0 * lifeRatio);
|
||||
bool expertMode = Main.expertMode || CalamityWorld.bossRushActive;
|
||||
bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive;
|
||||
bool death = CalamityWorld.death || CalamityWorld.bossRushActive;
|
||||
|
||||
CalamityGlobalNPC.voidBoss = npc.whoAmI;
|
||||
Vector2 vector = npc.Center;
|
||||
@@ -3280,8 +3283,6 @@ namespace CalamityMod.NPCs
|
||||
{
|
||||
calamityGlobalNPC.newAI[1] += expertMode ? 2f : 1f;
|
||||
calamityGlobalNPC.newAI[1] += calamityGlobalNPC.newAI[2];
|
||||
if (CalamityWorld.death || CalamityWorld.bossRushActive)
|
||||
calamityGlobalNPC.newAI[1] += 1f;
|
||||
if (calamityGlobalNPC.enraged > 0 || (Config.BossRushXerocCurse && CalamityWorld.bossRushActive))
|
||||
calamityGlobalNPC.newAI[1] += 2f;
|
||||
|
||||
@@ -3312,7 +3313,7 @@ namespace CalamityMod.NPCs
|
||||
if (revenge)
|
||||
{
|
||||
int damage = expertMode ? 50 : 60;
|
||||
if (lifePercentage < 50 || CalamityWorld.death || CalamityWorld.bossRushActive || !player.ZoneDungeon)
|
||||
if (lifePercentage < 50 || death || !player.ZoneDungeon)
|
||||
{
|
||||
for (int i = 0; i < 12; i++)
|
||||
{
|
||||
@@ -3413,6 +3414,7 @@ namespace CalamityMod.NPCs
|
||||
// Variables
|
||||
Player player = Main.player[npc.target];
|
||||
bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive;
|
||||
bool death = CalamityWorld.death || CalamityWorld.bossRushActive;
|
||||
Vector2 vector = npc.Center;
|
||||
|
||||
// Percent life remaining
|
||||
@@ -3421,16 +3423,16 @@ namespace CalamityMod.NPCs
|
||||
// Phases
|
||||
float mult = 1f +
|
||||
(revenge ? 0.25f : 0f) +
|
||||
((CalamityWorld.death || CalamityWorld.bossRushActive) ? 0.25f : 0f);
|
||||
(death ? 0.25f : 0f);
|
||||
bool phase2 = lifeRatio < 0.5f * mult;
|
||||
bool phase3 = lifeRatio < 0.1f * mult;
|
||||
|
||||
// Max spawn amount
|
||||
int num1305 = revenge ? 4 : 3;
|
||||
if (CalamityWorld.death || CalamityWorld.bossRushActive)
|
||||
if (death)
|
||||
num1305 = 5;
|
||||
if (phase2)
|
||||
num1305 = 2;
|
||||
num1305 = death ? 3 : 2;
|
||||
|
||||
// Don't collide with tiles, disable gravity
|
||||
npc.noTileCollide = false;
|
||||
|
||||
@@ -73,7 +73,8 @@ namespace CalamityMod.NPCs.Crabulon
|
||||
{
|
||||
Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0f, 0.5f, 1f);
|
||||
Player player = Main.player[npc.target];
|
||||
bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive;
|
||||
bool death = CalamityWorld.death || CalamityWorld.bossRushActive;
|
||||
bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive;
|
||||
bool expertMode = Main.expertMode || CalamityWorld.bossRushActive;
|
||||
npc.spriteDirection = (npc.direction > 0) ? 1 : -1;
|
||||
if (!player.active || player.dead)
|
||||
@@ -113,12 +114,12 @@ namespace CalamityMod.NPCs.Crabulon
|
||||
npc.localAI[3] += 2f;
|
||||
num352 += 3;
|
||||
}
|
||||
if ((double)npc.life < (double)npc.lifeMax * 0.5 || CalamityWorld.bossRushActive)
|
||||
if ((double)npc.life < (double)npc.lifeMax * 0.5 || death)
|
||||
{
|
||||
npc.localAI[3] += 1f;
|
||||
num352 += 2;
|
||||
}
|
||||
if ((double)npc.life < (double)npc.lifeMax * 0.1 || CalamityWorld.bossRushActive)
|
||||
if ((double)npc.life < (double)npc.lifeMax * 0.1 || death)
|
||||
{
|
||||
npc.localAI[3] += 2f;
|
||||
num352 += 3;
|
||||
@@ -148,21 +149,16 @@ namespace CalamityMod.NPCs.Crabulon
|
||||
num354 += 3;
|
||||
num353 += 3f;
|
||||
}
|
||||
if ((double)npc.life < (double)npc.lifeMax * 0.5 || CalamityWorld.bossRushActive)
|
||||
if ((double)npc.life < (double)npc.lifeMax * 0.5 || death)
|
||||
{
|
||||
num354++;
|
||||
num353 += 1f;
|
||||
}
|
||||
if ((double)npc.life < (double)npc.lifeMax * 0.1 || CalamityWorld.bossRushActive)
|
||||
if ((double)npc.life < (double)npc.lifeMax * 0.1 || death)
|
||||
{
|
||||
num354++;
|
||||
num353 += 1f;
|
||||
}
|
||||
if (CalamityWorld.death || CalamityWorld.bossRushActive)
|
||||
{
|
||||
num354 += 3;
|
||||
num353 += 1f;
|
||||
}
|
||||
vector34 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
num349 = player.position.X + (float)player.width * 0.5f - vector34.X;
|
||||
num350 = player.position.Y + (float)player.height * 0.5f - vector34.Y;
|
||||
@@ -214,9 +210,9 @@ namespace CalamityMod.NPCs.Crabulon
|
||||
{
|
||||
float num823 = 1.25f;
|
||||
bool flag51 = false;
|
||||
if ((double)npc.life < (double)npc.lifeMax * 0.5)
|
||||
if ((double)npc.life < (double)npc.lifeMax * 0.5 || death)
|
||||
num823 = 1.5f;
|
||||
if ((double)npc.life < (double)npc.lifeMax * 0.1)
|
||||
if ((double)npc.life < (double)npc.lifeMax * 0.1 || death)
|
||||
num823 = 2f;
|
||||
if (CalamityWorld.bossRushActive)
|
||||
num823 = 12f;
|
||||
@@ -333,11 +329,11 @@ namespace CalamityMod.NPCs.Crabulon
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (npc.life < npc.lifeMax / 2 || CalamityWorld.bossRushActive)
|
||||
if (npc.life < npc.lifeMax / 2 || death)
|
||||
{
|
||||
npc.ai[1] += (!revenge ? 4f : 1f);
|
||||
}
|
||||
if (npc.life < npc.lifeMax / 4 || CalamityWorld.bossRushActive)
|
||||
if (npc.life < npc.lifeMax / 4 || death)
|
||||
{
|
||||
npc.ai[1] += (!revenge ? 4f : 1f);
|
||||
}
|
||||
@@ -467,15 +463,11 @@ namespace CalamityMod.NPCs.Crabulon
|
||||
{
|
||||
num626 += 3f;
|
||||
}
|
||||
if (CalamityWorld.death || CalamityWorld.bossRushActive)
|
||||
{
|
||||
num626 += 2f;
|
||||
}
|
||||
if (npc.life < npc.lifeMax / 2 || CalamityWorld.bossRushActive)
|
||||
if (npc.life < npc.lifeMax / 2 || death)
|
||||
{
|
||||
num626 += 1f;
|
||||
}
|
||||
if (npc.life < npc.lifeMax / 10 || CalamityWorld.bossRushActive)
|
||||
if (npc.life < npc.lifeMax / 10 || death)
|
||||
{
|
||||
num626 += 1f;
|
||||
}
|
||||
|
||||
@@ -112,7 +112,8 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
bool isChill = player.ZoneSnow;
|
||||
bool expertMode = Main.expertMode || CalamityWorld.bossRushActive;
|
||||
bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive;
|
||||
double multAdd = revenge ? 0.1 : 0D;
|
||||
bool death = CalamityWorld.death || CalamityWorld.bossRushActive;
|
||||
double multAdd = revenge ? 0.1 : 0D;
|
||||
npc.TargetClosest(true);
|
||||
|
||||
if (npc.ai[2] == 0f && npc.localAI[1] == 0f && Main.netMode != NetmodeID.MultiplayerClient && (npc.ai[0] < 4f || CalamityWorld.bossRushActive)) //spawn shield for phase 0 1 2 3, not 4 5 6
|
||||
@@ -176,9 +177,6 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient && expertMode && (npc.ai[0] < 5f || !revenge || (double)npc.life >= (double)npc.lifeMax * 0.15))
|
||||
{
|
||||
time++;
|
||||
if (CalamityWorld.death || CalamityWorld.bossRushActive)
|
||||
time++;
|
||||
|
||||
if (time >= 600)
|
||||
{
|
||||
Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
@@ -236,7 +234,7 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
float num1244 = player.Center.Y - vector142.Y;
|
||||
float num1245 = (float)Math.Sqrt((double)(num1243 * num1243 + num1244 * num1244));
|
||||
float num1246 = isChill ? 4f : 8f;
|
||||
if (CalamityWorld.death)
|
||||
if (death)
|
||||
{
|
||||
num1246 = isChill ? 5f : 10f;
|
||||
}
|
||||
@@ -250,7 +248,8 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
npc.velocity.X = (npc.velocity.X * 50f + num1243) / 51f;
|
||||
npc.velocity.Y = (npc.velocity.Y * 50f + num1244) / 51f;
|
||||
|
||||
if ((double)npc.life < (double)npc.lifeMax * (0.83 + multAdd))
|
||||
double HPMult = death ? 0.95 : 0.83 + multAdd;
|
||||
if ((double)npc.life < (double)npc.lifeMax * HPMult)
|
||||
{
|
||||
npc.ai[0] = 1f;
|
||||
npc.localAI[0] = 0f;
|
||||
@@ -290,7 +289,7 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
|
||||
float velocity = isChill ? 7.5f : 4f;
|
||||
float acceleration = isChill ? 0.1f : 0.15f;
|
||||
if (CalamityWorld.death)
|
||||
if (death)
|
||||
velocity = isChill ? 7f : 3.5f;
|
||||
if (CalamityWorld.bossRushActive)
|
||||
{
|
||||
@@ -357,7 +356,8 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
}
|
||||
}
|
||||
|
||||
if ((double)npc.life < (double)npc.lifeMax * (0.66 + multAdd))
|
||||
double HPMult = death ? 0.8 : 0.66 + multAdd;
|
||||
if ((double)npc.life < (double)npc.lifeMax * HPMult)
|
||||
{
|
||||
npc.ai[0] = 2f;
|
||||
npc.localAI[0] = 0f;
|
||||
@@ -435,7 +435,7 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
float num1244 = player.Center.Y - vector142.Y;
|
||||
float num1245 = (float)Math.Sqrt((double)(num1243 * num1243 + num1244 * num1244));
|
||||
float num1246 = isChill ? 6f : 12f;
|
||||
if (CalamityWorld.death)
|
||||
if (death)
|
||||
{
|
||||
num1246 = isChill ? 7f : 14f;
|
||||
}
|
||||
@@ -449,7 +449,8 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
npc.velocity.X = (npc.velocity.X * 50f + num1243) / 51f;
|
||||
npc.velocity.Y = (npc.velocity.Y * 50f + num1244) / 51f;
|
||||
|
||||
if ((double)npc.life < (double)npc.lifeMax * (0.49 + multAdd))
|
||||
double HPMult = death ? 0.7 : 0.49 + multAdd;
|
||||
if ((double)npc.life < (double)npc.lifeMax * HPMult)
|
||||
{
|
||||
npc.ai[0] = 3f;
|
||||
npc.localAI[0] = 0f;
|
||||
@@ -501,7 +502,7 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
|
||||
float velocity = isChill ? 7.5f : 4f;
|
||||
float acceleration = isChill ? 0.1f : 0.15f;
|
||||
if (CalamityWorld.death)
|
||||
if (death)
|
||||
velocity = isChill ? 7f : 3.5f;
|
||||
if (CalamityWorld.bossRushActive)
|
||||
{
|
||||
@@ -568,7 +569,8 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
}
|
||||
}
|
||||
|
||||
if ((double)npc.life < (double)npc.lifeMax * (0.32 + multAdd))
|
||||
double HPMult = death ? 0.55 : 0.32 + multAdd;
|
||||
if ((double)npc.life < (double)npc.lifeMax * HPMult)
|
||||
{
|
||||
npc.ai[0] = 4f;
|
||||
npc.localAI[0] = 0f;
|
||||
@@ -705,7 +707,8 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
}
|
||||
}
|
||||
|
||||
if ((double)npc.life < (double)npc.lifeMax * (0.15 + multAdd))
|
||||
double HPMult = death ? 0.4 : 0.15 + multAdd;
|
||||
if ((double)npc.life < (double)npc.lifeMax * HPMult)
|
||||
{
|
||||
Main.PlaySound(4, (int)npc.position.X, (int)npc.position.Y, 15);
|
||||
drawAltTexture = true;
|
||||
@@ -758,7 +761,8 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
{
|
||||
npc.damage = (int)((float)npc.defDamage * 1.5f);
|
||||
|
||||
if (revenge && (double)npc.life < (double)npc.lifeMax * 0.15)
|
||||
double HPMult = death ? 0.25 : 0.15;
|
||||
if (revenge && (double)npc.life < (double)npc.lifeMax * HPMult)
|
||||
{
|
||||
if (npc.ai[1] == 60f)
|
||||
npc.velocity = Vector2.Normalize(player.Center - npc.Center) * (CalamityWorld.bossRushActive ? 30f : (isChill ? 18f : 24f));
|
||||
@@ -806,7 +810,7 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
num1374 *= num1376;
|
||||
iceShard--;
|
||||
|
||||
if ((double)npc.life < (double)npc.lifeMax * (0.1 + multAdd) || CalamityWorld.death || CalamityWorld.bossRushActive)
|
||||
if ((double)npc.life < (double)npc.lifeMax * (0.1 + multAdd) || death)
|
||||
{
|
||||
if (num1375 < 170f || iceShard > 0)
|
||||
{
|
||||
@@ -860,7 +864,7 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
else
|
||||
{
|
||||
time++;
|
||||
if (time >= 60)
|
||||
if (time >= 75)
|
||||
{
|
||||
Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
float spread = 45f * 0.0174f;
|
||||
@@ -908,7 +912,7 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
|
||||
float velocity = isChill ? 6f : 3f;
|
||||
float acceleration = isChill ? 0.2f : 0.3f;
|
||||
if (CalamityWorld.death)
|
||||
if (death)
|
||||
velocity = isChill ? 5f : 2.5f;
|
||||
if (CalamityWorld.bossRushActive)
|
||||
{
|
||||
@@ -959,7 +963,7 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
}
|
||||
}
|
||||
|
||||
if (!revenge || (double)npc.life >= (double)npc.lifeMax * 0.15)
|
||||
if (!revenge || (double)npc.life >= (double)npc.lifeMax * (death ? 0.25 : 0.15))
|
||||
{
|
||||
if (npc.ai[3] == 0f && npc.life > 0)
|
||||
{
|
||||
|
||||
@@ -89,6 +89,10 @@ namespace CalamityMod.NPCs.DevourerofGods
|
||||
{
|
||||
npc.dontTakeDamage = Main.npc[(int)npc.ai[2]].dontTakeDamage;
|
||||
}
|
||||
if (Main.npc[(int)npc.ai[2]].dontTakeDamage)
|
||||
{
|
||||
invinceTime = 240;
|
||||
}
|
||||
if (npc.ai[3] > 0f)
|
||||
{
|
||||
npc.realLife = (int)npc.ai[3];
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Placeables.Banners;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -69,11 +70,9 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
|
||||
public override void NPCLoot()
|
||||
{
|
||||
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<WulfrumShard>(), Main.rand.Next(1, 4));
|
||||
if (Main.expertMode && Main.rand.NextBool(2))
|
||||
{
|
||||
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<WulfrumShard>());
|
||||
}
|
||||
DropHelper.DropItem(npc, ModContent.ItemType<WulfrumShard>(), 1, 3);
|
||||
DropHelper.DropItemCondition(npc, ModContent.ItemType<WulfrumShard>(), Main.expertMode, 1, 1);
|
||||
DropHelper.DropItemChance(npc, ModContent.ItemType<WulfrumBattery>(), 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -194,10 +194,7 @@ namespace CalamityMod.NPCs.SunkenSea
|
||||
|
||||
public override void NPCLoot()
|
||||
{
|
||||
if (Main.rand.NextBool(3))
|
||||
{
|
||||
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<EutrophicShank>());
|
||||
}
|
||||
DropHelper.DropItemChance(npc, ModContent.ItemType<EutrophicShank>(), 3);
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
using CalamityMod.Items.Placeables.Banners;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System.IO;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.NPCs.SunkenSea
|
||||
{
|
||||
public class GhostBell : ModNPC
|
||||
@@ -157,5 +159,10 @@ namespace CalamityMod.NPCs.SunkenSea
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void NPCLoot()
|
||||
{
|
||||
DropHelper.DropItemChance(npc, ModContent.ItemType<VoltaicJelly>(), 5);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ using CalamityMod.Projectiles.Healing;
|
||||
using CalamityMod.Projectiles.Magic;
|
||||
using CalamityMod.Projectiles.Melee;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using CalamityMod.Projectiles.Summon;
|
||||
using CalamityMod.Projectiles.Typeless;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -1511,6 +1512,64 @@ namespace CalamityMod.Projectiles
|
||||
target.AddBuff(BuffID.ShadowFlame, 300);
|
||||
}
|
||||
|
||||
if (Main.player[projectile.owner].Calamity().voltaicJelly)
|
||||
{
|
||||
target.AddBuff(BuffID.Electrified, 60);
|
||||
}
|
||||
|
||||
if (Main.player[projectile.owner].Calamity().jellyChargedBattery)
|
||||
{
|
||||
if (Main.player[projectile.owner].Calamity().jellyDmg <= 0)
|
||||
{
|
||||
int num = projectile.damage / 2;
|
||||
Main.player[projectile.owner].Calamity().jellyDmg += (float)num;
|
||||
int[] array = new int[200];
|
||||
int num3 = 0;
|
||||
int num4 = 0;
|
||||
for (int i = 0; i < 200; i++)
|
||||
{
|
||||
if (Main.npc[i].CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float num5 = Math.Abs(Main.npc[i].position.X + (float)(Main.npc[i].width / 2) - projectile.position.X + (float)(projectile.width / 2)) + Math.Abs(Main.npc[i].position.Y + (float)(Main.npc[i].height / 2) - projectile.position.Y + (float)(projectile.height / 2));
|
||||
if (num5 < 800f)
|
||||
{
|
||||
if (Collision.CanHit(projectile.position, 1, 1, Main.npc[i].position, Main.npc[i].width, Main.npc[i].height) && num5 > 50f)
|
||||
{
|
||||
array[num4] = i;
|
||||
num4++;
|
||||
}
|
||||
else if (num4 == 0)
|
||||
{
|
||||
array[num3] = i;
|
||||
num3++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (num3 == 0 && num4 == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
int num6;
|
||||
if (num4 > 0)
|
||||
{
|
||||
num6 = array[Main.rand.Next(num4)];
|
||||
}
|
||||
else
|
||||
{
|
||||
num6 = array[Main.rand.Next(num3)];
|
||||
}
|
||||
float num7 = 15f;
|
||||
float num8 = (float)Main.rand.Next(-100, 101);
|
||||
float num9 = (float)Main.rand.Next(-100, 101);
|
||||
float num10 = (float)Math.Sqrt((double)(num8 * num8 + num9 * num9));
|
||||
num10 = num7 / num10;
|
||||
num8 *= num10;
|
||||
num9 *= num10;
|
||||
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, num8, num9, ModContent.ProjectileType<EnergyOrb>(), (int)((double)num * 1.2), 0f, projectile.owner, (float)num6, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
// Fearmonger set's colossal life regeneration
|
||||
CalamityPlayer modPlayer = Main.player[projectile.owner].Calamity();
|
||||
if(modPlayer.fearmongerSet)
|
||||
@@ -1575,13 +1634,6 @@ namespace CalamityMod.Projectiles
|
||||
}
|
||||
#endregion
|
||||
|
||||
/*#ModifyHitPlayer
|
||||
public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit)
|
||||
{
|
||||
target.Calamity().lastProjectileHit = ModContent.ProjectileType<BrimstoneHellblast>();
|
||||
}
|
||||
#endregion*/
|
||||
|
||||
#region CanDamage
|
||||
public override bool CanDamage(Projectile projectile)
|
||||
{
|
||||
|
||||
@@ -165,11 +165,13 @@ namespace CalamityMod.Projectiles.Pets
|
||||
projectile.velocity.Y = projectile.velocity.Y - num16 * 2f;
|
||||
}
|
||||
}
|
||||
|
||||
projectile.rotation = projectile.velocity.X * 0.05f;
|
||||
if ((double) projectile.velocity.X > 0.25)
|
||||
projectile.spriteDirection = projectile.direction = 1;
|
||||
else if ((double) projectile.velocity.X < -0.25)
|
||||
projectile.spriteDirection = projectile.direction = -1;
|
||||
|
||||
projectile.frameCounter++;
|
||||
if (projectile.frameCounter > 6)
|
||||
{
|
||||
@@ -237,7 +239,7 @@ namespace CalamityMod.Projectiles.Pets
|
||||
num406 = num403 / num406;
|
||||
num404 *= num406;
|
||||
num405 *= num406;
|
||||
Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 93);
|
||||
//Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 93);
|
||||
Projectile.NewProjectile(projectile.Center.X - 4f, projectile.Center.Y, num404, num405, ModContent.ProjectileType<RotomBeam>(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f);
|
||||
projectile.ai[0] = 50f;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Projectiles.Ranged
|
||||
{
|
||||
public class CardClub : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Club");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 5;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 14;
|
||||
projectile.height = 14;
|
||||
projectile.friendly = true;
|
||||
projectile.alpha = 255;
|
||||
projectile.penetrate = 1;
|
||||
projectile.timeLeft = 600;
|
||||
projectile.ranged = true;
|
||||
projectile.extraUpdates = 1;
|
||||
projectile.aiStyle = 1;
|
||||
aiType = ProjectileID.Bullet;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.5f / 255f, (255 - projectile.alpha) * 0f / 255f, (255 - projectile.alpha) * 0f / 255f);
|
||||
projectile.rotation -= (MathHelper.ToRadians(90) * projectile.direction);
|
||||
projectile.spriteDirection = projectile.direction;
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
int num137 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), 1, 1, 30, 0f, 0f, 0, default, 0.5f);
|
||||
Main.dust[num137].velocity *= 0f;
|
||||
Main.dust[num137].noGravity = true;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnTileCollide(Vector2 oldVelocity)
|
||||
{
|
||||
Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height);
|
||||
Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f);
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void Kill(int timeLeft)
|
||||
{
|
||||
for (int i = -8; i <= 8; i += 8)
|
||||
{
|
||||
Vector2 perturbedSpeed = new Vector2(projectile.velocity.X, projectile.velocity.Y).RotatedBy(MathHelper.ToRadians(i));
|
||||
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, perturbedSpeed.X, perturbedSpeed.Y, ModContent.ProjectileType<CardClubSplit>(), projectile.damage / 2, 0f, projectile.owner, 0f, 0f);
|
||||
}
|
||||
Main.PlaySound(SoundID.Item110, projectile.Center);
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 360);
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 186 B |
@@ -0,0 +1,114 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Projectiles.Ranged
|
||||
{
|
||||
public class CardClubSplit : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Club");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 5;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 14;
|
||||
projectile.height = 14;
|
||||
projectile.friendly = true;
|
||||
projectile.alpha = 255;
|
||||
projectile.penetrate = 1;
|
||||
projectile.timeLeft = 600;
|
||||
projectile.ranged = true;
|
||||
projectile.extraUpdates = 1;
|
||||
projectile.aiStyle = 1;
|
||||
aiType = ProjectileID.Bullet;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.5f / 255f, (255 - projectile.alpha) * 0f / 255f, (255 - projectile.alpha) * 0f / 255f);
|
||||
projectile.rotation -= (MathHelper.ToRadians(90) * projectile.direction);
|
||||
projectile.spriteDirection = projectile.direction;
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
int num137 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), 1, 1, 30, 0f, 0f, 0, default, 0.5f);
|
||||
Main.dust[num137].velocity *= 0f;
|
||||
Main.dust[num137].noGravity = true;
|
||||
}
|
||||
|
||||
if (projectile.alpha < 128)
|
||||
{
|
||||
float pcx = projectile.Center.X;
|
||||
float pcy = projectile.Center.Y;
|
||||
float var1 = 800f;
|
||||
bool flag = false;
|
||||
for (int npcvar = 0; npcvar < Main.npc.Length; npcvar++)
|
||||
{
|
||||
if (Main.npc[npcvar].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[npcvar].Center, 1, 1))
|
||||
{
|
||||
float var2 = Main.npc[npcvar].position.X + (Main.npc[npcvar].width / 2);
|
||||
float var3 = Main.npc[npcvar].position.Y + (Main.npc[npcvar].height / 2);
|
||||
float var4 = Math.Abs(projectile.position.X + (projectile.width / 2) - var2) + Math.Abs(projectile.position.Y + (projectile.height / 2) - var3);
|
||||
if (var4 < var1)
|
||||
{
|
||||
var1 = var4;
|
||||
pcx = var2;
|
||||
pcy = var3;
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (flag)
|
||||
{
|
||||
float homingstrenght = 12f;
|
||||
Vector2 vector1 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f);
|
||||
float var6 = pcx - vector1.X;
|
||||
float var7 = pcy - vector1.Y;
|
||||
float var8 = (float)Math.Sqrt(var6 * var6 + var7 * var7);
|
||||
var8 = homingstrenght / var8;
|
||||
var6 *= var8;
|
||||
var7 *= var8;
|
||||
projectile.velocity.X = (projectile.velocity.X * 20f + var6) / 21f;
|
||||
projectile.velocity.Y = (projectile.velocity.Y * 20f + var7) / 21f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnTileCollide(Vector2 oldVelocity)
|
||||
{
|
||||
Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height);
|
||||
Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f);
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void Kill(int timeLeft)
|
||||
{
|
||||
for (int k = 0; k < 2; k++)
|
||||
{
|
||||
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 30, projectile.oldVelocity.X * 0.15f, projectile.oldVelocity.Y * 0.15f);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 360);
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CanDamage()
|
||||
{
|
||||
return projectile.alpha < 128;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 186 B |
@@ -0,0 +1,124 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Projectiles.Ranged
|
||||
{
|
||||
public class CardDiamond : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Diamond");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 5;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 14;
|
||||
projectile.height = 14;
|
||||
projectile.friendly = true;
|
||||
projectile.alpha = 255;
|
||||
projectile.penetrate = 1;
|
||||
projectile.timeLeft = 600;
|
||||
projectile.ranged = true;
|
||||
projectile.extraUpdates = 1;
|
||||
projectile.aiStyle = 1;
|
||||
aiType = ProjectileID.Bullet;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.5f / 255f, (255 - projectile.alpha) * 0f / 255f, (255 - projectile.alpha) * 0f / 255f);
|
||||
projectile.rotation -= (MathHelper.ToRadians(90) * projectile.direction);
|
||||
projectile.spriteDirection = projectile.direction;
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
int num137 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), 1, 1, 30, 0f, 0f, 0, default, 0.5f);
|
||||
Main.dust[num137].velocity *= 0f;
|
||||
Main.dust[num137].noGravity = true;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnTileCollide(Vector2 oldVelocity)
|
||||
{
|
||||
Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height);
|
||||
Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f);
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void Kill(int timeLeft)
|
||||
{
|
||||
projectile.position = projectile.Center;
|
||||
projectile.width = projectile.height = 50;
|
||||
projectile.position.X = projectile.position.X - (float)(projectile.width / 2);
|
||||
projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2);
|
||||
projectile.maxPenetrate = -1;
|
||||
projectile.penetrate = -1;
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = 10;
|
||||
projectile.Damage();
|
||||
Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14);
|
||||
for (int num621 = 0; num621 < 10; num621++)
|
||||
{
|
||||
int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 30, 0f, 0f, 100, default, 2f);
|
||||
Main.dust[num622].velocity *= 3f;
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
Main.dust[num622].scale = 0.5f;
|
||||
Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
|
||||
}
|
||||
}
|
||||
for (int num623 = 0; num623 < 15; num623++)
|
||||
{
|
||||
int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 30, 0f, 0f, 100, default, 3f);
|
||||
Main.dust[num624].noGravity = true;
|
||||
Main.dust[num624].velocity *= 5f;
|
||||
num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 30, 0f, 0f, 100, default, 2f);
|
||||
Main.dust[num624].velocity *= 2f;
|
||||
}
|
||||
for (int num625 = 0; num625 < 10; num625++)
|
||||
{
|
||||
float scaleFactor10 = 0.33f;
|
||||
if (num625 == 1)
|
||||
{
|
||||
scaleFactor10 = 0.66f;
|
||||
}
|
||||
if (num625 == 2)
|
||||
{
|
||||
scaleFactor10 = 1f;
|
||||
}
|
||||
int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f);
|
||||
Gore gore = Main.gore[num626];
|
||||
gore.velocity *= scaleFactor10;
|
||||
gore.velocity.X += 1f;
|
||||
gore.velocity.Y += 1f;
|
||||
num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f);
|
||||
gore.velocity *= scaleFactor10;
|
||||
gore.velocity.X -= 1f;
|
||||
gore.velocity.Y += 1f;
|
||||
num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f);
|
||||
gore.velocity *= scaleFactor10;
|
||||
gore.velocity.X += 1f;
|
||||
gore.velocity.Y -= 1f;
|
||||
num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f);
|
||||
gore.velocity *= scaleFactor10;
|
||||
gore.velocity.X -= 1f;
|
||||
gore.velocity.Y -= 1f;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 360);
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 234 B |
@@ -0,0 +1,78 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Projectiles.Ranged
|
||||
{
|
||||
public class CardHeart : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Heart");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 5;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 14;
|
||||
projectile.height = 14;
|
||||
projectile.friendly = true;
|
||||
projectile.alpha = 255;
|
||||
projectile.penetrate = 1;
|
||||
projectile.timeLeft = 600;
|
||||
projectile.ranged = true;
|
||||
projectile.extraUpdates = 1;
|
||||
projectile.aiStyle = 1;
|
||||
aiType = ProjectileID.Bullet;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.5f / 255f, (255 - projectile.alpha) * 0f / 255f, (255 - projectile.alpha) * 0f / 255f);
|
||||
projectile.rotation -= (MathHelper.ToRadians(90) * projectile.direction);
|
||||
projectile.spriteDirection = projectile.direction;
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
int num137 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), 1, 1, 30, 0f, 0f, 0, default, 0.5f);
|
||||
Main.dust[num137].velocity *= 0f;
|
||||
Main.dust[num137].noGravity = true;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnTileCollide(Vector2 oldVelocity)
|
||||
{
|
||||
Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height);
|
||||
Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f);
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void Kill(int timeLeft)
|
||||
{
|
||||
for (int k = 0; k < 2; k++)
|
||||
{
|
||||
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 30, projectile.oldVelocity.X * 0.15f, projectile.oldVelocity.Y * 0.15f);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 360);
|
||||
if (target.type == NPCID.TargetDummy)
|
||||
{
|
||||
return;
|
||||
}
|
||||
Player player = Main.player[projectile.owner];
|
||||
player.statLife += 1;
|
||||
player.HealEffect(1);
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 228 B |
@@ -0,0 +1,73 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Projectiles.Ranged
|
||||
{
|
||||
public class CardSpade : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Spade");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 5;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 14;
|
||||
projectile.height = 14;
|
||||
projectile.friendly = true;
|
||||
projectile.alpha = 255;
|
||||
projectile.penetrate = -1;
|
||||
projectile.timeLeft = 600;
|
||||
projectile.ranged = true;
|
||||
projectile.extraUpdates = 1;
|
||||
projectile.aiStyle = 1;
|
||||
aiType = ProjectileID.Bullet;
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = 4;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.5f / 255f, (255 - projectile.alpha) * 0f / 255f, (255 - projectile.alpha) * 0f / 255f);
|
||||
projectile.rotation -= (MathHelper.ToRadians(90) * projectile.direction);
|
||||
projectile.spriteDirection = projectile.direction;
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
int num137 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), 1, 1, 30, 0f, 0f, 0, default, 0.5f);
|
||||
Main.dust[num137].velocity *= 0f;
|
||||
Main.dust[num137].noGravity = true;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnTileCollide(Vector2 oldVelocity)
|
||||
{
|
||||
Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height);
|
||||
Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f);
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void Kill(int timeLeft)
|
||||
{
|
||||
for (int k = 0; k < 2; k++)
|
||||
{
|
||||
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 30, projectile.oldVelocity.X * 0.15f, projectile.oldVelocity.Y * 0.15f);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 360);
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 189 B |
@@ -202,8 +202,8 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
double offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i;
|
||||
int proj1 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType<MagnomalyBeam>(), projectile.damage / 5, projectile.knockBack / 5, projectile.owner, 0f, 1f);
|
||||
int proj2 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType<MagnomalyBeam>(), projectile.damage / 5, projectile.knockBack / 5, projectile.owner, 0f, 1f);
|
||||
int proj1 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType<MagnomalyBeam>(), projectile.damage / 4, projectile.knockBack / 4, projectile.owner, 0f, 1f);
|
||||
int proj2 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType<MagnomalyBeam>(), projectile.damage / 4, projectile.knockBack / 4, projectile.owner, 0f, 1f);
|
||||
}
|
||||
target.AddBuff(ModContent.BuffType<ExoFreeze>(), 30);
|
||||
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 120);
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
|
||||
namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
public class HypothermiaChunk : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Ice Chunk");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 6;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 20;
|
||||
projectile.height = 20;
|
||||
projectile.friendly = true;
|
||||
projectile.penetrate = 1;
|
||||
projectile.timeLeft = 80;
|
||||
projectile.extraUpdates = 3;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.Calamity().rogue = true;
|
||||
projectile.tileCollide = false;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
//Rotation
|
||||
projectile.spriteDirection = projectile.direction = (projectile.velocity.X > 0).ToDirectionInt();
|
||||
projectile.rotation = projectile.velocity.ToRotation() + (projectile.spriteDirection == 1 ? 0f : MathHelper.Pi);
|
||||
|
||||
Lighting.AddLight(projectile.Center, 0.1f, 0f, 0.5f);
|
||||
if (projectile.ai[0] < 0.2f)
|
||||
{
|
||||
projectile.ai[0] += 0.1f;
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.tileCollide = true;
|
||||
}
|
||||
|
||||
if (Main.rand.Next(10) == 0)
|
||||
{
|
||||
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 191, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f, 0, default, 0.8f);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Kill(int timeLeft)
|
||||
{
|
||||
for (int i = 0; i <= 3; i++)
|
||||
{
|
||||
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 191, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f, 0, default, 0.8f);
|
||||
}
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
for (int num252 = 0; num252 < 3; num252++)
|
||||
{
|
||||
Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101));
|
||||
while (value15.X == 0f && value15.Y == 0f)
|
||||
{
|
||||
value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101));
|
||||
}
|
||||
value15.Normalize();
|
||||
value15 *= (float)Main.rand.Next(70, 101) * 0.1f;
|
||||
int shard = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType<HypothermiaShard>(), (int)((float)projectile.damage * 0.75f), projectile.knockBack * 0.75f, Main.myPlayer, Main.rand.Next(0,4), 1f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
target.AddBuff(BuffID.Frostburn, 300);
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 613 B |
@@ -0,0 +1,101 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
public class HypothermiaShard : ModProjectile
|
||||
{
|
||||
private float counter = 0f;
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Ice Shard");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 6;
|
||||
projectile.height = 6;
|
||||
projectile.scale = 1f;
|
||||
projectile.friendly = true;
|
||||
projectile.alpha = 50;
|
||||
projectile.penetrate = 1;
|
||||
projectile.timeLeft = 600;
|
||||
projectile.Calamity().rogue = true;
|
||||
projectile.extraUpdates = 3;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Lighting.AddLight(projectile.Center, 0.1f, 0f, 0.5f);
|
||||
projectile.rotation += projectile.velocity.X * 0.2f;
|
||||
counter += 0.25f;
|
||||
if (Main.rand.NextBool(10))
|
||||
{
|
||||
int num300 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 191, 0f, 0f, 0, default, 0.8f);
|
||||
Main.dust[num300].noGravity = true;
|
||||
Main.dust[num300].velocity *= 0.2f;
|
||||
}
|
||||
projectile.velocity *= 0.996f;
|
||||
if (counter > 100f)
|
||||
{
|
||||
projectile.scale -= 0.05f;
|
||||
if ((double)projectile.scale <= 0.2)
|
||||
{
|
||||
projectile.scale = 0.2f;
|
||||
projectile.Kill();
|
||||
}
|
||||
projectile.width = (int)(6f * projectile.scale);
|
||||
projectile.height = (int)(6f * projectile.scale);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnTileCollide(Vector2 oldVelocity)
|
||||
{
|
||||
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 void Kill(int timeLeft)
|
||||
{
|
||||
for (int k = 0; k < 3; k++)
|
||||
{
|
||||
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 191, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f, 0, default, 0.8f);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
target.AddBuff(BuffID.Frostburn, 120);
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
//Changes the texture of the projectile
|
||||
Texture2D texture = Main.projectileTexture[projectile.type];
|
||||
if (projectile.ai[0] == 1f)
|
||||
{
|
||||
texture = ModContent.GetTexture("CalamityMod/Projectiles/Rogue/HypothermiaShard2");
|
||||
}
|
||||
if (projectile.ai[0] == 2f)
|
||||
{
|
||||
texture = ModContent.GetTexture("CalamityMod/Projectiles/Rogue/HypothermiaShard3");
|
||||
}
|
||||
if (projectile.ai[0] == 3f)
|
||||
{
|
||||
texture = ModContent.GetTexture("CalamityMod/Projectiles/Rogue/HypothermiaShard4");
|
||||
}
|
||||
Main.spriteBatch.Draw(texture, projectile.Center - Main.screenPosition, new Rectangle?(new Rectangle(0, 0, texture.Width, texture.Height)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2(texture.Width / 2f, texture.Height / 2f), projectile.scale, SpriteEffects.None, 0f);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 198 B |
|
After Width: | Height: | Size: 211 B |
|
After Width: | Height: | Size: 229 B |
|
After Width: | Height: | Size: 221 B |
@@ -65,10 +65,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
int num988 = 15;
|
||||
bool flag54 = false;
|
||||
bool flag55 = false;
|
||||
float[] var_2_2CB4E_cp_0 = projectile.localAI;
|
||||
int var_2_2CB4E_cp_1 = 0;
|
||||
float num73 = var_2_2CB4E_cp_0[var_2_2CB4E_cp_1];
|
||||
var_2_2CB4E_cp_0[var_2_2CB4E_cp_1] = num73 + 1f;
|
||||
projectile.localAI[0] += 1f;
|
||||
if (projectile.localAI[0] % 30f == 0f)
|
||||
{
|
||||
flag55 = true;
|
||||
|
||||
@@ -49,10 +49,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
int num988 = 15;
|
||||
bool flag54 = false;
|
||||
bool flag55 = false;
|
||||
float[] var_2_2CB4E_cp_0 = projectile.localAI;
|
||||
int var_2_2CB4E_cp_1 = 0;
|
||||
float num73 = var_2_2CB4E_cp_0[var_2_2CB4E_cp_1];
|
||||
var_2_2CB4E_cp_0[var_2_2CB4E_cp_1] = num73 + 1f;
|
||||
projectile.localAI[0] += 1f;
|
||||
if (projectile.localAI[0] % 30f == 0f)
|
||||
{
|
||||
flag55 = true;
|
||||
|
||||
@@ -49,10 +49,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
int num988 = 15;
|
||||
bool flag54 = false;
|
||||
bool flag55 = false;
|
||||
float[] var_2_2CB4E_cp_0 = projectile.localAI;
|
||||
int var_2_2CB4E_cp_1 = 0;
|
||||
float num73 = var_2_2CB4E_cp_0[var_2_2CB4E_cp_1];
|
||||
var_2_2CB4E_cp_0[var_2_2CB4E_cp_1] = num73 + 1f;
|
||||
projectile.localAI[0] += 1f;
|
||||
if (projectile.localAI[0] % 30f == 0f)
|
||||
{
|
||||
flag55 = true;
|
||||
|
||||
@@ -49,10 +49,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
int num988 = 15;
|
||||
bool flag54 = false;
|
||||
bool flag55 = false;
|
||||
float[] var_2_2CB4E_cp_0 = projectile.localAI;
|
||||
int var_2_2CB4E_cp_1 = 0;
|
||||
float num73 = var_2_2CB4E_cp_0[var_2_2CB4E_cp_1];
|
||||
var_2_2CB4E_cp_0[var_2_2CB4E_cp_1] = num73 + 1f;
|
||||
projectile.localAI[0] += 1f;
|
||||
if (projectile.localAI[0] % 30f == 0f)
|
||||
{
|
||||
flag55 = true;
|
||||
|
||||
@@ -38,10 +38,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
}
|
||||
if (projectile.ai[0] == 0f)
|
||||
{
|
||||
float[] var_2_2CA48_cp_0 = projectile.ai;
|
||||
int var_2_2CA48_cp_1 = 1;
|
||||
float num73 = var_2_2CA48_cp_0[var_2_2CA48_cp_1];
|
||||
var_2_2CA48_cp_0[var_2_2CA48_cp_1] = num73 + 1f;
|
||||
projectile.ai[1] += 1f;
|
||||
if (projectile.ai[1] >= 45f)
|
||||
{
|
||||
float num986 = 0.98f;
|
||||
@@ -67,10 +64,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
int num988 = 15;
|
||||
bool flag54 = false;
|
||||
bool flag55 = false;
|
||||
float[] var_2_2CB4E_cp_0 = projectile.localAI;
|
||||
int var_2_2CB4E_cp_1 = 0;
|
||||
float num73 = var_2_2CB4E_cp_0[var_2_2CB4E_cp_1];
|
||||
var_2_2CB4E_cp_0[var_2_2CB4E_cp_1] = num73 + 1f;
|
||||
projectile.localAI[0] += 1f;
|
||||
if (projectile.localAI[0] % 30f == 0f)
|
||||
{
|
||||
flag55 = true;
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
for (int i = 0; i < numProj; i++)
|
||||
{
|
||||
Vector2 perturbedspeed = new Vector2(projectile.velocity.X, projectile.velocity.Y + Main.rand.Next(-3, 4)).RotatedBy(MathHelper.ToRadians(spread));
|
||||
int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, perturbedspeed.X * 0.2f, perturbedspeed.Y * 0.2f, ModContent.ProjectileType<ShatteredSunFireball>(), (int)((double)projectile.damage * 1.5), 1f, projectile.owner, 0f, 0f);
|
||||
int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, perturbedspeed.X * 0.2f, perturbedspeed.Y * 0.2f, ModContent.ProjectileType<ShatteredSunFireball>(), (int)((double)projectile.damage * 0.5), 1f, projectile.owner, 0f, 0f);
|
||||
Main.projectile[proj].Calamity().stealthStrike = projectile.Calamity().stealthStrike;
|
||||
spread -= Main.rand.Next(2, 6);
|
||||
}
|
||||
|
||||
@@ -41,10 +41,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
int num988 = 15;
|
||||
bool flag54 = false;
|
||||
bool flag55 = false;
|
||||
float[] var_2_2CB4E_cp_0 = projectile.localAI;
|
||||
int var_2_2CB4E_cp_1 = 0;
|
||||
float num73 = var_2_2CB4E_cp_0[var_2_2CB4E_cp_1];
|
||||
var_2_2CB4E_cp_0[var_2_2CB4E_cp_1] = num73 + 1f;
|
||||
projectile.localAI[0] += 1f;
|
||||
if (projectile.localAI[0] % 30f == 0f)
|
||||
{
|
||||
flag55 = true;
|
||||
|
||||
@@ -102,7 +102,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
}
|
||||
value15.Normalize();
|
||||
value15 *= (float)Main.rand.Next(70, 101) * 0.1f;
|
||||
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType<SupernovaSpike>(), (int)((double)projectile.damage * 0.5), 0f, projectile.owner, 0f, 0f);
|
||||
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType<SupernovaSpike>(), (int)((double)projectile.damage * 0.6), 0f, projectile.owner, 0f, 0f);
|
||||
}
|
||||
float spread = 60f * 0.0174f;
|
||||
double startAngle = Math.Atan2(projectile.velocity.X, projectile.velocity.Y) - spread / 2;
|
||||
@@ -112,8 +112,8 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i;
|
||||
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 2f), (float)(Math.Cos(offsetAngle) * 2f), ModContent.ProjectileType<SupernovaHoming>(), (int)((double)projectile.damage * 0.4), projectile.knockBack, projectile.owner, 0f, 0f);
|
||||
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 2f), (float)(-Math.Cos(offsetAngle) * 2f), ModContent.ProjectileType<SupernovaHoming>(), (int)((double)projectile.damage * 0.4), projectile.knockBack, projectile.owner, 0f, 0f);
|
||||
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 2f), (float)(Math.Cos(offsetAngle) * 2f), ModContent.ProjectileType<SupernovaHoming>(), (int)((double)projectile.damage * 0.5), projectile.knockBack, projectile.owner, 0f, 0f);
|
||||
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 2f), (float)(-Math.Cos(offsetAngle) * 2f), ModContent.ProjectileType<SupernovaHoming>(), (int)((double)projectile.damage * 0.5), projectile.knockBack, projectile.owner, 0f, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
projectile.penetrate = -1;
|
||||
projectile.timeLeft = 5;
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = 1;
|
||||
projectile.localNPCHitCooldown = 0;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
|
||||
@@ -80,33 +80,16 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
if (crit) //homing
|
||||
for (int num252 = 0; num252 < 4; num252++)
|
||||
{
|
||||
for (int num252 = 0; num252 < 4; num252++)
|
||||
Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101));
|
||||
while (value15.X == 0f && value15.Y == 0f)
|
||||
{
|
||||
Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101));
|
||||
while (value15.X == 0f && value15.Y == 0f)
|
||||
{
|
||||
value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101));
|
||||
}
|
||||
value15.Normalize();
|
||||
value15 *= (float)Main.rand.Next(70, 101) * 0.1f;
|
||||
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType<TurbulanceWindSlash>(), projectile.damage / 3, projectile.knockBack / 3, Main.myPlayer, 0f, 1f);
|
||||
}
|
||||
}
|
||||
else //not homing
|
||||
{
|
||||
for (int num252 = 0; num252 < 4; num252++)
|
||||
{
|
||||
Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101));
|
||||
while (value15.X == 0f && value15.Y == 0f)
|
||||
{
|
||||
value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101));
|
||||
}
|
||||
value15.Normalize();
|
||||
value15 *= (float)Main.rand.Next(70, 101) * 0.1f;
|
||||
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType<TurbulanceWindSlash>(), projectile.damage / 3, projectile.knockBack / 3, Main.myPlayer, 0f, 0f);
|
||||
value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101));
|
||||
}
|
||||
value15.Normalize();
|
||||
value15 *= (float)Main.rand.Next(70, 101) * 0.1f;
|
||||
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType<TurbulanceWindSlash>(), projectile.damage / 3, projectile.knockBack / 3, Main.myPlayer, 0f, (crit ? 1f /*homing*/: 0f/*not homing*/));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Projectiles.Summon
|
||||
{
|
||||
@@ -12,6 +13,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
{
|
||||
DisplayName.SetDefault("Dreadmine Turret");
|
||||
Main.projFrames[projectile.type] = 2;
|
||||
ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Summon
|
||||
{
|
||||
public class EnergyOrb : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Energy Orb");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 14;
|
||||
projectile.height = 14;
|
||||
projectile.alpha = 100;
|
||||
projectile.friendly = true;
|
||||
projectile.penetrate = 1;
|
||||
projectile.tileCollide = false;
|
||||
projectile.timeLeft = 200;
|
||||
projectile.minion = true;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
projectile.localAI[0] += 1f;
|
||||
if (projectile.localAI[0] > 4f)
|
||||
{
|
||||
for (int num468 = 0; num468 < 1; num468++)
|
||||
{
|
||||
int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 132, 0f, 0f, 100, default, 1f);
|
||||
if (Main.rand.Next(6) != 0)
|
||||
Main.dust[num469].noGravity = true;
|
||||
Main.dust[num469].velocity *= 0f;
|
||||
}
|
||||
}
|
||||
float num472 = projectile.Center.X;
|
||||
float num473 = projectile.Center.Y;
|
||||
float num474 = 400f;
|
||||
bool flag17 = false;
|
||||
for (int num475 = 0; num475 < Main.npc.Length; num475++)
|
||||
{
|
||||
if (Main.npc[num475].CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2);
|
||||
float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2);
|
||||
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
|
||||
if (num478 < num474)
|
||||
{
|
||||
num474 = num478;
|
||||
num472 = num476;
|
||||
num473 = num477;
|
||||
flag17 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (flag17)
|
||||
{
|
||||
float num483 = 10f;
|
||||
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
float num484 = num472 - vector35.X;
|
||||
float num485 = num473 - vector35.Y;
|
||||
float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485));
|
||||
num486 = num483 / num486;
|
||||
num484 *= num486;
|
||||
num485 *= num486;
|
||||
projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f;
|
||||
projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
target.AddBuff(BuffID.Electrified, 120);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 302 B |
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Projectiles.Summon
|
||||
{
|
||||
@@ -10,6 +11,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
{
|
||||
DisplayName.SetDefault("Hive");
|
||||
Main.projFrames[projectile.type] = 6;
|
||||
ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Projectiles.Summon
|
||||
{
|
||||
@@ -11,6 +12,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Lantern");
|
||||
ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
|
||||
@@ -16,6 +16,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
{
|
||||
DisplayName.SetDefault("Mechworm");
|
||||
ProjectileID.Sets.MinionSacrificable[projectile.type] = true;
|
||||
ProjectileID.Sets.NeedsUUID[projectile.type] = true;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
@@ -97,7 +98,6 @@ namespace CalamityMod.Projectiles.Summon
|
||||
}
|
||||
}
|
||||
value68 = Main.projectile[chase].Center;
|
||||
Vector2 arg_2DE6A_0 = Main.projectile[chase].velocity;
|
||||
num1064 = Main.projectile[chase].rotation;
|
||||
scaleFactor18 = MathHelper.Clamp(Main.projectile[chase].scale, 0f, 50f);
|
||||
scaleFactor17 = 16f;
|
||||
|
||||
@@ -16,6 +16,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
{
|
||||
DisplayName.SetDefault("Mechworm");
|
||||
ProjectileID.Sets.MinionSacrificable[projectile.type] = true;
|
||||
ProjectileID.Sets.NeedsUUID[projectile.type] = true;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
DisplayName.SetDefault("Mechworm");
|
||||
ProjectileID.Sets.MinionSacrificable[projectile.type] = true;
|
||||
ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true;
|
||||
ProjectileID.Sets.NeedsUUID[projectile.type] = true;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
|
||||
@@ -16,6 +16,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
{
|
||||
DisplayName.SetDefault("Mechworm");
|
||||
ProjectileID.Sets.MinionSacrificable[projectile.type] = true;
|
||||
ProjectileID.Sets.NeedsUUID[projectile.type] = true;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
@@ -73,34 +74,30 @@ namespace CalamityMod.Projectiles.Summon
|
||||
projectile.ai[1] = 0f;
|
||||
projectile.netUpdate = true;
|
||||
}
|
||||
int chase = (int)projectile.ai[0];
|
||||
float num1064;
|
||||
float scaleFactor17;
|
||||
float scaleFactor18;
|
||||
if (chase >= 0 && Main.projectile[chase].active)
|
||||
int byUUID = Projectile.GetByUUID(projectile.owner, (int)projectile.ai[0]);
|
||||
if (byUUID >= 0 && Main.projectile[byUUID].active && (Main.projectile[byUUID].type == ModContent.ProjectileType<MechwormHead>() ||
|
||||
Main.projectile[byUUID].type == ModContent.ProjectileType<MechwormBody>() ||
|
||||
Main.projectile[byUUID].type == ModContent.ProjectileType<MechwormBody2>()))
|
||||
{
|
||||
//Delete the player's mechworm if it's attaching to something weird
|
||||
if (Main.projectile[chase].type != ModContent.ProjectileType<MechwormBody2>() &&
|
||||
Main.projectile[chase].type != ModContent.ProjectileType<MechwormBody>())
|
||||
value68 = Main.projectile[byUUID].Center;
|
||||
num1064 = Main.projectile[byUUID].rotation;
|
||||
float num1063 = MathHelper.Clamp(Main.projectile[byUUID].scale, 0f, 50f);
|
||||
scaleFactor17 = 16f;
|
||||
scaleFactor18 = num1063;
|
||||
Main.projectile[byUUID].localAI[0] = projectile.localAI[0] + 1f;
|
||||
if (Main.projectile[byUUID].type != ModContent.ProjectileType<MechwormHead>())
|
||||
{
|
||||
for (int i = 0; i < Main.projectile.Length; i++)
|
||||
{
|
||||
if (Main.projectile[i].active && Main.projectile[i].owner == projectile.owner &&
|
||||
(Main.projectile[i].type == ModContent.ProjectileType<MechwormBody2>() ||
|
||||
Main.projectile[i].type == ModContent.ProjectileType<MechwormBody>() ||
|
||||
Main.projectile[i].type == ModContent.ProjectileType<MechwormHead>() ||
|
||||
Main.projectile[i].type == ModContent.ProjectileType<MechwormTail>()))
|
||||
{
|
||||
Main.projectile[i].Kill();
|
||||
}
|
||||
}
|
||||
Main.projectile[byUUID].localAI[1] = (float)projectile.whoAmI;
|
||||
}
|
||||
if (projectile.owner == Main.myPlayer && Main.projectile[byUUID].type == ModContent.ProjectileType<MechwormHead>() && projectile.type == ModContent.ProjectileType<MechwormTail>())
|
||||
{
|
||||
Main.projectile[byUUID].Kill();
|
||||
projectile.Kill();
|
||||
return;
|
||||
}
|
||||
value68 = Main.projectile[chase].Center;
|
||||
Vector2 arg_2DE6A_0 = Main.projectile[chase].velocity;
|
||||
num1064 = Main.projectile[chase].rotation;
|
||||
scaleFactor18 = MathHelper.Clamp(Main.projectile[chase].scale, 0f, 50f);
|
||||
scaleFactor17 = 6f;
|
||||
Main.projectile[chase].localAI[0] = projectile.localAI[0] + 1f;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Projectiles.Summon
|
||||
{
|
||||
@@ -11,6 +12,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
{
|
||||
DisplayName.SetDefault("Spikecrag");
|
||||
Main.projFrames[projectile.type] = 4;
|
||||
ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
|
||||