Merge branch 'master' of https://github.com/UncleDanny/CalamityMod
No files matched your search
@@ -389,6 +389,10 @@ namespace CalamityMod.CalPlayer
|
||||
public bool gloveOfPrecision = false;
|
||||
public bool gloveOfRecklessness = false;
|
||||
public bool momentumCapacitor = false;
|
||||
public bool vampiricTalisman = false;
|
||||
public bool electricianGlove = false;
|
||||
public bool bloodyGlove = false;
|
||||
public bool filthyGlove = false;
|
||||
|
||||
// Armor Set
|
||||
public bool victideSet = false;
|
||||
@@ -1126,6 +1130,10 @@ namespace CalamityMod.CalPlayer
|
||||
gloveOfPrecision = false;
|
||||
gloveOfRecklessness = false;
|
||||
momentumCapacitor = false;
|
||||
vampiricTalisman = false;
|
||||
electricianGlove = false;
|
||||
bloodyGlove = false;
|
||||
filthyGlove = false;
|
||||
|
||||
alcoholPoisoning = false;
|
||||
shadowflame = false;
|
||||
@@ -5091,11 +5099,12 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
|
||||
// For the stat meter
|
||||
damageStats[0] = (int)((player.meleeDamage - 1f) * 100f);
|
||||
damageStats[1] = (int)((player.rangedDamage - 1f) * 100f);
|
||||
damageStats[2] = (int)((player.magicDamage - 1f) * 100f);
|
||||
damageStats[3] = (int)((player.minionDamage - 1f) * 100f);
|
||||
damageStats[4] = (int)((player.Calamity().throwingDamage - 1f) * 100f);
|
||||
float allDamageStat = player.allDamage - 1f;
|
||||
damageStats[0] = (int)((player.meleeDamage + allDamageStat - 1f) * 100f);
|
||||
damageStats[1] = (int)((player.rangedDamage + allDamageStat - 1f) * 100f);
|
||||
damageStats[2] = (int)((player.magicDamage + allDamageStat - 1f) * 100f);
|
||||
damageStats[3] = (int)((player.minionDamage + allDamageStat - 1f) * 100f);
|
||||
damageStats[4] = (int)((player.Calamity().throwingDamage + allDamageStat - 1f) * 100f);
|
||||
critStats[0] = player.meleeCrit;
|
||||
critStats[1] = player.rangedCrit;
|
||||
critStats[2] = player.magicCrit;
|
||||
@@ -6817,6 +6826,10 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((filthyGlove || electricianGlove) && proj.Calamity().stealthStrike && proj.Calamity().rogue)
|
||||
{
|
||||
damageMult += 0.01;
|
||||
}
|
||||
damage = (int)((double)damage * damageMult);
|
||||
|
||||
if (oldDie)
|
||||
@@ -6846,6 +6859,28 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
damage += Main.rand.Next(20, 31);
|
||||
}
|
||||
if (proj.Calamity().stealthStrike && proj.Calamity().rogue && electricianGlove)
|
||||
{
|
||||
if (target.defense >= 30)
|
||||
{
|
||||
damage += 15;
|
||||
}
|
||||
else
|
||||
{
|
||||
damage += (int)((double)target.defense * 0.5);
|
||||
}
|
||||
}
|
||||
else if (proj.Calamity().stealthStrike && proj.Calamity().rogue && (filthyGlove || bloodyGlove))
|
||||
{
|
||||
if (target.defense >= 10)
|
||||
{
|
||||
damage += 5;
|
||||
}
|
||||
else
|
||||
{
|
||||
damage += (int)((double)target.defense * 0.5);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region MultiplicativeReductions
|
||||
@@ -6913,6 +6948,22 @@ namespace CalamityMod.CalPlayer
|
||||
Projectile.NewProjectile(proj.oldPosition.X + (float)(proj.width / 2), proj.oldPosition.Y + (float)(proj.height / 2), value15.X, value15.Y, ModContent.ProjectileType<UnstableSpark>(), (int)((double)damage * 0.15), 0f, player.whoAmI, 0f, 0f);
|
||||
}
|
||||
}
|
||||
if (electricianGlove && proj.Calamity().stealthStrike && proj.Calamity().rogue)
|
||||
{
|
||||
for (int num252 = 0; num252 < 3; num252++)
|
||||
{
|
||||
Vector2 value15 = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51));
|
||||
while (value15.X == 0f && value15.Y == 0f)
|
||||
{
|
||||
value15 = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51));
|
||||
}
|
||||
value15.Normalize();
|
||||
value15 *= (float)Main.rand.Next(30, 61) * 0.1f;
|
||||
int num17 = Projectile.NewProjectile(proj.oldPosition.X + (float)(proj.width / 2), proj.oldPosition.Y + (float)(proj.height / 2), value15.X, value15.Y, ModContent.ProjectileType<Spark>(), (int)((double)damage * 0.1), 0f, player.whoAmI, 0f, 0f);
|
||||
Main.projectile[num17].Calamity().forceRogue = true;
|
||||
Main.projectile[num17].localNPCHitCooldown = -1;
|
||||
}
|
||||
}
|
||||
if (astralStarRain && crit && astralStarRainCooldown <= 0)
|
||||
{
|
||||
astralStarRainCooldown = 60;
|
||||
|
||||
@@ -104,11 +104,6 @@ namespace CalamityMod
|
||||
public static int astralKillCount = 0;
|
||||
|
||||
// Textures & Shaders
|
||||
public static Texture2D heartOriginal2;
|
||||
public static Texture2D heartOriginal;
|
||||
public static Texture2D rainOriginal;
|
||||
public static Texture2D manaOriginal;
|
||||
public static Texture2D carpetOriginal;
|
||||
public static Texture2D AstralCactusTexture;
|
||||
public static Texture2D AstralCactusGlowTexture;
|
||||
public static Texture2D AstralSky;
|
||||
@@ -178,12 +173,6 @@ namespace CalamityMod
|
||||
#region Load
|
||||
public override void Load()
|
||||
{
|
||||
heartOriginal2 = Main.heartTexture;
|
||||
heartOriginal = Main.heart2Texture;
|
||||
rainOriginal = Main.rainTexture;
|
||||
manaOriginal = Main.manaTexture;
|
||||
carpetOriginal = Main.flyingCarpetTexture;
|
||||
|
||||
NormalityRelocatorHotKey = RegisterHotKey("Normality Relocator", "Z");
|
||||
RageHotKey = RegisterHotKey("Rage Mode", "V");
|
||||
AdrenalineHotKey = RegisterHotKey("Adrenaline Mode", "B");
|
||||
@@ -351,21 +340,6 @@ namespace CalamityMod
|
||||
|
||||
AstralArcanumUI.Unload();
|
||||
base.Unload();
|
||||
|
||||
if (!Main.dedServ)
|
||||
{
|
||||
Main.heartTexture = heartOriginal2;
|
||||
Main.heart2Texture = heartOriginal;
|
||||
Main.rainTexture = rainOriginal;
|
||||
Main.manaTexture = manaOriginal;
|
||||
Main.flyingCarpetTexture = carpetOriginal;
|
||||
}
|
||||
|
||||
heartOriginal2 = null;
|
||||
heartOriginal = null;
|
||||
rainOriginal = null;
|
||||
manaOriginal = null;
|
||||
carpetOriginal = null;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.CalPlayer;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
public class BloodstainedGlove : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Bloodstained Glove");
|
||||
Tooltip.SetDefault("Stealth strikes have +10 armor penetration and heal for 1 HP");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 26;
|
||||
item.height = 36;
|
||||
item.value = Item.buyPrice(0, 4, 0, 0);
|
||||
item.accessory = true;
|
||||
item.rare = 3;
|
||||
}
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
modPlayer.bloodyGlove = true;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ModContent.ItemType<BloodSample>(), 5);
|
||||
recipe.AddIngredient(ItemID.Vertebrae, 4);
|
||||
recipe.AddIngredient(ItemID.CrimtaneBar, 4);
|
||||
recipe.AddTile(TileID.DemonAltar);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 603 B |
@@ -0,0 +1,50 @@
|
||||
using CalamityMod.CalPlayer;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
public class ElectriciansGlove : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Electrician's Glove");
|
||||
Tooltip.SetDefault(@"Stealth strikes summon sparks on enemy hits
|
||||
Stealth strikes also have +30 armor penetration, deal 10% more damage, and heal for 1 HP");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 24;
|
||||
item.height = 40;
|
||||
item.value = Item.buyPrice(0, 36, 0, 0);
|
||||
item.accessory = true;
|
||||
item.rare = 6;
|
||||
}
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
modPlayer.electricianGlove = true;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ModContent.ItemType<FilthyGlove>());
|
||||
recipe.AddIngredient(ItemID.Wire, 100);
|
||||
recipe.AddIngredient(ItemID.HallowedBar, 5);
|
||||
recipe.AddTile(TileID.MythrilAnvil);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ModContent.ItemType<BloodstainedGlove>());
|
||||
recipe.AddIngredient(ItemID.Wire, 100);
|
||||
recipe.AddIngredient(ItemID.HallowedBar, 5);
|
||||
recipe.AddTile(TileID.MythrilAnvil);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 628 B |
@@ -0,0 +1,43 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.CalPlayer;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
public class FilthyGlove : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Filthy Glove");
|
||||
Tooltip.SetDefault("Stealth strikes have +10 armor penetration and deal 10% more damage");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 24;
|
||||
item.height = 38;
|
||||
item.value = Item.buyPrice(0, 4, 0, 0);
|
||||
item.accessory = true;
|
||||
item.rare = 3;
|
||||
}
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
modPlayer.filthyGlove = true;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ItemID.RottenChunk, 4);
|
||||
recipe.AddIngredient(ItemID.DemoniteBar, 4);
|
||||
recipe.AddIngredient(ModContent.ItemType<TrueShadowScale>(), 5);
|
||||
recipe.AddTile(TileID.DemonAltar);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 636 B |
@@ -33,7 +33,8 @@ namespace CalamityMod.Items.Accessories
|
||||
if (line2.mod == "Terraria" && line2.Name == "Tooltip0")
|
||||
{
|
||||
line2.text = "Rogue projectiles create nanoblades as they travel\n" +
|
||||
"Stealth strikes summon lunar flares on enemy hits\n" +
|
||||
"Stealth strikes summon lunar flares and sparks on enemy hits\n" +
|
||||
"Stealth strikes have +30 armor penetration, deal 10% more damage, and heal for 1 HP\n" +
|
||||
"Rogue weapons have a chance to instantly kill normal enemies\n" +
|
||||
"10% increased rogue damage, 5% increased rogue crit chance, and 15% increased rogue velocity\n" +
|
||||
"Whenever you crit an enemy with a rogue weapon your rogue damage increases\n" +
|
||||
@@ -50,6 +51,7 @@ namespace CalamityMod.Items.Accessories
|
||||
modPlayer.nanotech = true;
|
||||
modPlayer.moonCrown = true;
|
||||
modPlayer.raiderTalisman = true;
|
||||
modPlayer.electricianGlove = true;
|
||||
player.Calamity().throwingDamage += 0.1f;
|
||||
player.Calamity().throwingCrit += 5;
|
||||
player.Calamity().throwingVelocity += 0.15f;
|
||||
@@ -61,13 +63,7 @@ namespace CalamityMod.Items.Accessories
|
||||
recipe.AddIngredient(ModContent.ItemType<RogueEmblem>());
|
||||
recipe.AddIngredient(ModContent.ItemType<RaidersTalisman>());
|
||||
recipe.AddIngredient(ModContent.ItemType<MoonstoneCrown>());
|
||||
|
||||
// add this ingredient when the item is finished
|
||||
// recipe.AddIngredient(ModContent.ItemType<ElectriciansGlove>());
|
||||
|
||||
// remove these two ingredients once Electrician's Glove is added
|
||||
recipe.AddIngredient(ItemID.MartianConduitPlating, 250);
|
||||
recipe.AddIngredient(ItemID.Nanites, 500);
|
||||
recipe.AddIngredient(ModContent.ItemType<ElectriciansGlove>());
|
||||
|
||||
recipe.AddIngredient(ModContent.ItemType<Phantoplasm>(), 20);
|
||||
recipe.AddIngredient(ModContent.ItemType<NightmareFuel>(), 20);
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Items.Materials;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
public class VampiricTalisman : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Vampiric Talisman");
|
||||
Tooltip.SetDefault(@"Rogue projectiles give lifesteal on crits
|
||||
12% increased rogue damage");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 50;
|
||||
item.height = 26;
|
||||
item.value = Item.buyPrice(0, 40, 0, 0);
|
||||
item.accessory = true;
|
||||
item.rare = 6;
|
||||
}
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
modPlayer.vampiricTalisman = true;
|
||||
player.Calamity().throwingDamage += 0.12f;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ModContent.ItemType<RogueEmblem>());
|
||||
recipe.AddIngredient(ModContent.ItemType<SolarVeil>(), 10);
|
||||
recipe.AddTile(TileID.MythrilAnvil);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 711 B |
@@ -0,0 +1,23 @@
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Materials
|
||||
{
|
||||
public class SolarVeil : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Solar Veil");
|
||||
Tooltip.SetDefault("Sunlight cannot penetrate the fabric of this cloth");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 26;
|
||||
item.height = 26;
|
||||
item.maxStack = 999;
|
||||
item.value = Item.buyPrice(0, 2, 0, 0);
|
||||
item.rare = 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 643 B |
@@ -45,6 +45,7 @@ namespace CalamityMod.Items.SummonItems
|
||||
{
|
||||
if (player.ZoneDungeon)
|
||||
{
|
||||
NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType<CeaselessVoid>());
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
for (int num662 = 0; num662 < 2; num662++)
|
||||
@@ -54,8 +55,7 @@ namespace CalamityMod.Items.SummonItems
|
||||
NPC.NewNPC((int)player.Center.X, (int)player.Center.Y + 200, ModContent.NPCType<DarkEnergy3>());
|
||||
}
|
||||
}
|
||||
NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType<CeaselessVoid>());
|
||||
}
|
||||
}
|
||||
else if (player.ZoneUnderworldHeight)
|
||||
{
|
||||
NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType<Signus>());
|
||||
|
||||
@@ -57,6 +57,7 @@ namespace CalamityMod.Items.TreasureBags
|
||||
|
||||
// Equipment
|
||||
DropHelper.DropItem(player, ModContent.ItemType<RottenBrain>());
|
||||
DropHelper.DropItemChance(player, ModContent.ItemType<FilthyGlove>(), 3);
|
||||
|
||||
// Vanity
|
||||
DropHelper.DropItemChance(player, ModContent.ItemType<HiveMindMask>(), 7);
|
||||
|
||||
@@ -59,6 +59,7 @@ namespace CalamityMod.Items.TreasureBags
|
||||
|
||||
// Equipment
|
||||
DropHelper.DropItem(player, ModContent.ItemType<BloodyWormTooth>());
|
||||
DropHelper.DropItemChance(player, ModContent.ItemType<BloodstainedGlove>(), 3);
|
||||
|
||||
// Vanity
|
||||
DropHelper.DropItemChance(player, ModContent.ItemType<PerforatorMask>(), 7);
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
public class FantasyTalisman : RogueWeapon
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Fantasy Talisman");
|
||||
Tooltip.SetDefault(@"Fires high velocity talismans that ignore gravity
|
||||
Talismans attach to enemies, causing them to release lost souls
|
||||
Stealth strikes release more souls and leave behind souls as they travel");
|
||||
}
|
||||
|
||||
public override void SafeSetDefaults()
|
||||
{
|
||||
item.width = 34;
|
||||
item.damage = 90;
|
||||
item.noMelee = true;
|
||||
item.consumable = true;
|
||||
item.noUseGraphic = true;
|
||||
item.useAnimation = 14;
|
||||
item.useTime = 14;
|
||||
item.useStyle = 1;
|
||||
item.knockBack = 6f;
|
||||
item.UseSound = SoundID.Item1;
|
||||
item.autoReuse = true;
|
||||
item.height = 62;
|
||||
item.maxStack = 999;
|
||||
item.value = Item.buyPrice(0, 0, 60, 0);
|
||||
item.rare = 7;
|
||||
item.shoot = ModContent.ProjectileType<FantasyTalismanProj>();
|
||||
item.shootSpeed = 18f;
|
||||
item.Calamity().rogue = true;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike
|
||||
{
|
||||
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ModContent.ItemType<SolarVeil>());
|
||||
recipe.AddIngredient(ItemID.Ectoplasm);
|
||||
recipe.AddTile(TileID.MythrilAnvil);
|
||||
recipe.SetResult(this, 5);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 645 B |
@@ -1627,6 +1627,13 @@ namespace CalamityMod.NPCs
|
||||
DropHelper.DropItemChance(npc, ModContent.ItemType<MurkyPaste>(), Main.expertMode ? 4 : 5);
|
||||
break;
|
||||
|
||||
case NPCID.Reaper:
|
||||
case NPCID.Psycho:
|
||||
DropHelper.DropItemCondition(npc, ModContent.ItemType<SolarVeil>(), (CalamityWorld.downedCalamitas || NPC.downedPlantBoss), Main.expertMode ? 0.1f : 0.05f, 1, 3);
|
||||
DropHelper.DropItemCondition(npc, ModContent.ItemType<DarksunFragment>(), CalamityWorld.downedBuffedMothron, Main.expertMode ? 0.06f : 0.04f, 1, 1);
|
||||
break;
|
||||
|
||||
//other solar eclipse creatures
|
||||
case NPCID.Eyezor:
|
||||
case NPCID.Frankenstein:
|
||||
case NPCID.SwampThing:
|
||||
@@ -1634,13 +1641,11 @@ namespace CalamityMod.NPCs
|
||||
case NPCID.VampireBat:
|
||||
case NPCID.CreatureFromTheDeep:
|
||||
case NPCID.Fritz:
|
||||
case NPCID.Reaper:
|
||||
case NPCID.ThePossessed:
|
||||
case NPCID.Butcher:
|
||||
case NPCID.DeadlySphere:
|
||||
case NPCID.DrManFly:
|
||||
case NPCID.Nailhead:
|
||||
case NPCID.Psycho:
|
||||
DropHelper.DropItemCondition(npc, ModContent.ItemType<DarksunFragment>(), CalamityWorld.downedBuffedMothron, Main.expertMode ? 0.06f : 0.04f, 1, 1);
|
||||
break;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Armor.Vanity;
|
||||
using CalamityMod.Items.LoreItems;
|
||||
using CalamityMod.Items.Materials;
|
||||
@@ -700,6 +701,9 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
DropHelper.DropItemChance(npc, ModContent.ItemType<DankStaff>(), 4);
|
||||
DropHelper.DropItemChance(npc, ModContent.ItemType<RotBall>(), 4, 25, 50);
|
||||
|
||||
//Equipment
|
||||
DropHelper.DropItemChance(npc, ModContent.ItemType<FilthyGlove>(), 4);
|
||||
|
||||
// Vanity
|
||||
DropHelper.DropItemChance(npc, ModContent.ItemType<HiveMindMask>(), 7);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Armor.Vanity;
|
||||
using CalamityMod.Items.LoreItems;
|
||||
using CalamityMod.Items.Materials;
|
||||
@@ -315,6 +316,9 @@ namespace CalamityMod.NPCs.Perforator
|
||||
DropHelper.DropItemChance(npc, ModContent.ItemType<BloodClotStaff>(), 4);
|
||||
DropHelper.DropItemChance(npc, ModContent.ItemType<ToothBall>(), 4, 25, 50);
|
||||
|
||||
//Equipment
|
||||
DropHelper.DropItemChance(npc, ModContent.ItemType<BloodstainedGlove>(), 4);
|
||||
|
||||
// Vanity
|
||||
DropHelper.DropItemChance(npc, ModContent.ItemType<PerforatorMask>(), 7);
|
||||
DropHelper.DropItemChance(npc, ModContent.ItemType<BloodyVein>(), 10);
|
||||
|
||||
@@ -845,6 +845,32 @@ namespace CalamityMod.Projectiles
|
||||
Main.player[Main.myPlayer].lifeSteal -= num;
|
||||
}
|
||||
|
||||
if (Main.player[projectile.owner].Calamity().vampiricTalisman && rogue && crit)
|
||||
{
|
||||
if (target.type == NPCID.TargetDummy)
|
||||
return;
|
||||
|
||||
float heal = (float)damage * 0.015f;
|
||||
if ((int)heal == 0)
|
||||
return;
|
||||
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
|
||||
return;
|
||||
|
||||
Main.player[Main.myPlayer].lifeSteal -= heal * 1.5f;
|
||||
int owner = projectile.owner;
|
||||
Projectile.NewProjectile(target.position.X, target.position.Y, 0f, 0f, ProjectileID.VampireHeal, 0, 0f, projectile.owner, (float)owner, heal);
|
||||
}
|
||||
|
||||
if ((Main.player[projectile.owner].Calamity().bloodyGlove || Main.player[projectile.owner].Calamity().electricianGlove) && rogue && stealthStrike)
|
||||
{
|
||||
if (target.type == NPCID.TargetDummy || !target.canGhostHeal)
|
||||
{
|
||||
return;
|
||||
}
|
||||
Main.player[projectile.owner].statLife += 1;
|
||||
Main.player[projectile.owner].HealEffect(1);
|
||||
}
|
||||
|
||||
if (Main.player[projectile.owner].Calamity().alchFlask &&
|
||||
(projectile.magic || rogue || projectile.melee || projectile.minion || projectile.ranged || projectile.sentry || CalamityMod.projectileMinionList.Contains(projectile.type)) &&
|
||||
Main.player[projectile.owner].ownedProjectileCounts[ModContent.ProjectileType<PlagueSeeker>()] < 6)
|
||||
@@ -1361,8 +1387,7 @@ namespace CalamityMod.Projectiles
|
||||
float speedX = (target.Center.X - pos.X) / 30f;
|
||||
float speedY = (target.Center.Y - pos.Y) * 8;
|
||||
int feather = Projectile.NewProjectile(pos.X, pos.Y, speedX, speedY, ModContent.ProjectileType<StickyFeather>(), 15, 3, projectile.owner, 0f, (float)Main.rand.Next(15));
|
||||
Main.projectile[feather].magic = false;
|
||||
Main.projectile[feather].Calamity().rogue = true;
|
||||
Main.projectile[feather].Calamity().forceRogue = true;
|
||||
playerC.Calamity().featherCrownCooldown = 15;
|
||||
}
|
||||
}
|
||||
@@ -1376,7 +1401,6 @@ namespace CalamityMod.Projectiles
|
||||
Vector2 velocity = (target.Center - pos) / 10f;
|
||||
float AI1 = (float)Main.rand.Next(3);
|
||||
int flare = Projectile.NewProjectile(pos, velocity, ProjectileID.LunarFlare, 50, 3, projectile.owner, 0f, AI1);
|
||||
Main.projectile[flare].magic = false;
|
||||
Main.projectile[flare].Calamity().forceRogue = true;
|
||||
playerC.Calamity().moonCrownCooldown = 15;
|
||||
}
|
||||
|
||||
@@ -22,50 +22,45 @@ namespace CalamityMod.Projectiles.Healing
|
||||
projectile.extraUpdates = 3;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
int num487 = (int)projectile.ai[0];
|
||||
float num488 = 5.5f;
|
||||
public override void AI()
|
||||
{
|
||||
int num487 = (int)projectile.ai[0];
|
||||
float num488 = 5.5f;
|
||||
if (Main.player[num487].lifeMagnet)
|
||||
num488 *= 1.5f;
|
||||
|
||||
Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
float num489 = Main.player[num487].Center.X - vector36.X;
|
||||
float num490 = Main.player[num487].Center.Y - vector36.Y;
|
||||
float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490));
|
||||
if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech)
|
||||
{
|
||||
int num492 = (int)projectile.ai[1];
|
||||
Main.player[num487].HealEffect(num492, false);
|
||||
Main.player[num487].statLife += num492;
|
||||
if (Main.player[num487].statLife > Main.player[num487].statLifeMax2)
|
||||
{
|
||||
Main.player[num487].statLife = Main.player[num487].statLifeMax2;
|
||||
}
|
||||
NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
projectile.Kill();
|
||||
}
|
||||
num491 = num488 / num491;
|
||||
num489 *= num491;
|
||||
num490 *= num491;
|
||||
projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f;
|
||||
projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f;
|
||||
for (int num497 = 0; num497 < 1; num497++)
|
||||
{
|
||||
float num498 = projectile.velocity.X * 0.2f * (float)num497;
|
||||
float num499 = -(projectile.velocity.Y * 0.2f) * (float)num497;
|
||||
int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default, 2f);
|
||||
Main.dust[num500].noGravity = true;
|
||||
Main.dust[num500].velocity *= 0f;
|
||||
Dust expr_154F9_cp_0 = Main.dust[num500];
|
||||
expr_154F9_cp_0.position.X -= num498;
|
||||
Dust expr_15518_cp_0 = Main.dust[num500];
|
||||
expr_15518_cp_0.position.Y -= num499;
|
||||
}
|
||||
return;
|
||||
}
|
||||
float num489 = Main.player[num487].Center.X - vector36.X;
|
||||
float num490 = Main.player[num487].Center.Y - vector36.Y;
|
||||
float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490));
|
||||
if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech)
|
||||
{
|
||||
int num492 = (int)projectile.ai[1];
|
||||
Main.player[num487].HealEffect(num492, false);
|
||||
Main.player[num487].statLife += num492;
|
||||
if (Main.player[num487].statLife > Main.player[num487].statLifeMax2)
|
||||
{
|
||||
Main.player[num487].statLife = Main.player[num487].statLifeMax2;
|
||||
}
|
||||
NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
projectile.Kill();
|
||||
}
|
||||
num491 = num488 / num491;
|
||||
num489 *= num491;
|
||||
num490 *= num491;
|
||||
projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f;
|
||||
projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f;
|
||||
float num498 = projectile.velocity.X * 0.2f;
|
||||
float num499 = -(projectile.velocity.Y * 0.2f);
|
||||
int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default, 2f);
|
||||
Main.dust[num500].noGravity = true;
|
||||
Dust expr_154F9_cp_0 = Main.dust[num500];
|
||||
expr_154F9_cp_0.position.X -= num498;
|
||||
Dust expr_15518_cp_0 = Main.dust[num500];
|
||||
expr_15518_cp_0.position.Y -= num499;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,42 +22,48 @@ namespace CalamityMod.Projectiles.Healing
|
||||
projectile.timeLeft = 180;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
projectile.velocity.X *= 0.95f;
|
||||
projectile.velocity.Y *= 0.95f;
|
||||
int num487 = (int)projectile.ai[0];
|
||||
Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
float num489 = Main.player[num487].Center.X - vector36.X;
|
||||
float num490 = Main.player[num487].Center.Y - vector36.Y;
|
||||
float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490));
|
||||
if (num491 < (Main.player[num487].lifeMagnet ? 75f : 50f) && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
int num492 = 3;
|
||||
Main.player[num487].HealEffect(num492, false);
|
||||
Main.player[num487].statLife += num492;
|
||||
if (Main.player[num487].statLife > Main.player[num487].statLifeMax2)
|
||||
{
|
||||
Main.player[num487].statLife = Main.player[num487].statLifeMax2;
|
||||
}
|
||||
NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
projectile.Kill();
|
||||
}
|
||||
for (int num497 = 0; num497 < 1; num497++)
|
||||
{
|
||||
float num498 = projectile.velocity.X * 0.2f * (float)num497;
|
||||
float num499 = -(projectile.velocity.Y * 0.2f) * (float)num497;
|
||||
int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 1f);
|
||||
Main.dust[num500].noGravity = true;
|
||||
Main.dust[num500].velocity *= 0f;
|
||||
Dust expr_154F9_cp_0 = Main.dust[num500];
|
||||
expr_154F9_cp_0.position.X -= num498;
|
||||
Dust expr_15518_cp_0 = Main.dust[num500];
|
||||
expr_15518_cp_0.position.Y -= num499;
|
||||
}
|
||||
}
|
||||
public override void AI()
|
||||
{
|
||||
projectile.velocity.X *= 0.95f;
|
||||
projectile.velocity.Y *= 0.95f;
|
||||
|
||||
int num487 = (int)projectile.ai[0];
|
||||
Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
float num489 = Main.player[num487].Center.X - vector36.X;
|
||||
float num490 = Main.player[num487].Center.Y - vector36.Y;
|
||||
float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490));
|
||||
if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
int num492 = 3;
|
||||
Main.player[num487].HealEffect(num492, false);
|
||||
Main.player[num487].statLife += num492;
|
||||
if (Main.player[num487].statLife > Main.player[num487].statLifeMax2)
|
||||
{
|
||||
Main.player[num487].statLife = Main.player[num487].statLifeMax2;
|
||||
}
|
||||
NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
projectile.Kill();
|
||||
}
|
||||
if (Main.player[num487].lifeMagnet && projectile.timeLeft < 120)
|
||||
{
|
||||
float num488 = 6f;
|
||||
num491 = num488 / num491;
|
||||
num489 *= num491;
|
||||
num490 *= num491;
|
||||
projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f;
|
||||
projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f;
|
||||
}
|
||||
float num498 = projectile.velocity.X * 0.2f;
|
||||
float num499 = -(projectile.velocity.Y * 0.2f);
|
||||
int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 1f);
|
||||
Main.dust[num500].noGravity = true;
|
||||
Dust expr_154F9_cp_0 = Main.dust[num500];
|
||||
expr_154F9_cp_0.position.X -= num498;
|
||||
Dust expr_15518_cp_0 = Main.dust[num500];
|
||||
expr_15518_cp_0.position.Y -= num499;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25,12 +25,13 @@ namespace CalamityMod.Projectiles.Healing
|
||||
public override void AI()
|
||||
{
|
||||
projectile.velocity.Y *= 0.98f;
|
||||
|
||||
int num487 = projectile.owner;
|
||||
Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
float num489 = Main.player[num487].Center.X - vector36.X;
|
||||
float num490 = Main.player[num487].Center.Y - vector36.Y;
|
||||
float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490));
|
||||
if (num491 < (Main.player[num487].lifeMagnet ? 75f : 50f) && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y)
|
||||
if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
@@ -45,11 +46,19 @@ namespace CalamityMod.Projectiles.Healing
|
||||
}
|
||||
projectile.Kill();
|
||||
}
|
||||
float num498 = projectile.velocity.X * 0.2f * 1f;
|
||||
float num499 = -(projectile.velocity.Y * 0.2f) * 1f;
|
||||
if (Main.player[num487].lifeMagnet && projectile.timeLeft < 120)
|
||||
{
|
||||
float num488 = 12f;
|
||||
num491 = num488 / num491;
|
||||
num489 *= num491;
|
||||
num490 *= num491;
|
||||
projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f;
|
||||
projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f;
|
||||
}
|
||||
float num498 = projectile.velocity.X * 0.2f;
|
||||
float num499 = -(projectile.velocity.Y * 0.2f);
|
||||
int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, new Color(0, 200, 0), 1.5f);
|
||||
Main.dust[num500].noGravity = true;
|
||||
Main.dust[num500].velocity *= 0f;
|
||||
Dust expr_154F9_cp_0 = Main.dust[num500];
|
||||
expr_154F9_cp_0.position.X -= num498;
|
||||
Dust expr_15518_cp_0 = Main.dust[num500];
|
||||
|
||||
@@ -22,50 +22,45 @@ namespace CalamityMod.Projectiles.Healing
|
||||
projectile.extraUpdates = 3;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
int num487 = (int)projectile.ai[0];
|
||||
float num488 = 8f;
|
||||
public override void AI()
|
||||
{
|
||||
int num487 = (int)projectile.ai[0];
|
||||
float num488 = 8f;
|
||||
if (Main.player[num487].lifeMagnet)
|
||||
num488 *= 1.5f;
|
||||
|
||||
Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
float num489 = Main.player[num487].Center.X - vector36.X;
|
||||
float num490 = Main.player[num487].Center.Y - vector36.Y;
|
||||
float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490));
|
||||
if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech)
|
||||
{
|
||||
int num492 = (int)projectile.ai[1];
|
||||
Main.player[num487].HealEffect(num492, false);
|
||||
Main.player[num487].statLife += num492;
|
||||
if (Main.player[num487].statLife > Main.player[num487].statLifeMax2)
|
||||
{
|
||||
Main.player[num487].statLife = Main.player[num487].statLifeMax2;
|
||||
}
|
||||
NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
projectile.Kill();
|
||||
}
|
||||
num491 = num488 / num491;
|
||||
num489 *= num491;
|
||||
num490 *= num491;
|
||||
projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f;
|
||||
projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f;
|
||||
for (int num497 = 0; num497 < 1; num497++)
|
||||
{
|
||||
float num498 = projectile.velocity.X * 0.2f * (float)num497;
|
||||
float num499 = -(projectile.velocity.Y * 0.2f) * (float)num497;
|
||||
int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 74, 0f, 0f, 100, default, 1f);
|
||||
Main.dust[num500].noGravity = true;
|
||||
Main.dust[num500].velocity *= 0f;
|
||||
Dust expr_154F9_cp_0 = Main.dust[num500];
|
||||
expr_154F9_cp_0.position.X -= num498;
|
||||
Dust expr_15518_cp_0 = Main.dust[num500];
|
||||
expr_15518_cp_0.position.Y -= num499;
|
||||
}
|
||||
return;
|
||||
}
|
||||
float num489 = Main.player[num487].Center.X - vector36.X;
|
||||
float num490 = Main.player[num487].Center.Y - vector36.Y;
|
||||
float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490));
|
||||
if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech)
|
||||
{
|
||||
int num492 = (int)projectile.ai[1];
|
||||
Main.player[num487].HealEffect(num492, false);
|
||||
Main.player[num487].statLife += num492;
|
||||
if (Main.player[num487].statLife > Main.player[num487].statLifeMax2)
|
||||
{
|
||||
Main.player[num487].statLife = Main.player[num487].statLifeMax2;
|
||||
}
|
||||
NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
projectile.Kill();
|
||||
}
|
||||
num491 = num488 / num491;
|
||||
num489 *= num491;
|
||||
num490 *= num491;
|
||||
projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f;
|
||||
projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f;
|
||||
float num498 = projectile.velocity.X * 0.2f;
|
||||
float num499 = -(projectile.velocity.Y * 0.2f);
|
||||
int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 74, 0f, 0f, 100, default, 1f);
|
||||
Main.dust[num500].noGravity = true;
|
||||
Dust expr_154F9_cp_0 = Main.dust[num500];
|
||||
expr_154F9_cp_0.position.X -= num498;
|
||||
Dust expr_15518_cp_0 = Main.dust[num500];
|
||||
expr_15518_cp_0.position.Y -= num499;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,50 +22,45 @@ namespace CalamityMod.Projectiles.Healing
|
||||
projectile.extraUpdates = 3;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
int num487 = (int)projectile.ai[0];
|
||||
float num488 = 8f;
|
||||
public override void AI()
|
||||
{
|
||||
int num487 = (int)projectile.ai[0];
|
||||
float num488 = 8f;
|
||||
if (Main.player[num487].lifeMagnet)
|
||||
num488 *= 1.5f;
|
||||
|
||||
Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
float num489 = Main.player[num487].Center.X - vector36.X;
|
||||
float num490 = Main.player[num487].Center.Y - vector36.Y;
|
||||
float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490));
|
||||
if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech)
|
||||
{
|
||||
int num492 = (int)projectile.ai[1];
|
||||
Main.player[num487].HealEffect(num492, false);
|
||||
Main.player[num487].statLife += num492;
|
||||
if (Main.player[num487].statLife > Main.player[num487].statLifeMax2)
|
||||
{
|
||||
Main.player[num487].statLife = Main.player[num487].statLifeMax2;
|
||||
}
|
||||
NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
projectile.Kill();
|
||||
}
|
||||
num491 = num488 / num491;
|
||||
num489 *= num491;
|
||||
num490 *= num491;
|
||||
projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f;
|
||||
projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f;
|
||||
for (int num497 = 0; num497 < 1; num497++)
|
||||
{
|
||||
float num498 = projectile.velocity.X * 0.2f * (float)num497;
|
||||
float num499 = -(projectile.velocity.Y * 0.2f) * (float)num497;
|
||||
int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, new Color(0, 255, 255), 1f);
|
||||
Main.dust[num500].noGravity = true;
|
||||
Main.dust[num500].velocity *= 0f;
|
||||
Dust expr_154F9_cp_0 = Main.dust[num500];
|
||||
expr_154F9_cp_0.position.X -= num498;
|
||||
Dust expr_15518_cp_0 = Main.dust[num500];
|
||||
expr_15518_cp_0.position.Y -= num499;
|
||||
}
|
||||
return;
|
||||
}
|
||||
float num489 = Main.player[num487].Center.X - vector36.X;
|
||||
float num490 = Main.player[num487].Center.Y - vector36.Y;
|
||||
float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490));
|
||||
if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech)
|
||||
{
|
||||
int num492 = (int)projectile.ai[1];
|
||||
Main.player[num487].HealEffect(num492, false);
|
||||
Main.player[num487].statLife += num492;
|
||||
if (Main.player[num487].statLife > Main.player[num487].statLifeMax2)
|
||||
{
|
||||
Main.player[num487].statLife = Main.player[num487].statLifeMax2;
|
||||
}
|
||||
NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
projectile.Kill();
|
||||
}
|
||||
num491 = num488 / num491;
|
||||
num489 *= num491;
|
||||
num490 *= num491;
|
||||
projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f;
|
||||
projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f;
|
||||
float num498 = projectile.velocity.X * 0.2f;
|
||||
float num499 = -(projectile.velocity.Y * 0.2f);
|
||||
int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, new Color(0, 255, 255), 1f);
|
||||
Main.dust[num500].noGravity = true;
|
||||
Dust expr_154F9_cp_0 = Main.dust[num500];
|
||||
expr_154F9_cp_0.position.X -= num498;
|
||||
Dust expr_15518_cp_0 = Main.dust[num500];
|
||||
expr_15518_cp_0.position.Y -= num499;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -39,6 +39,7 @@ namespace CalamityMod.Projectiles.Healing
|
||||
}
|
||||
projectile.localAI[0] += 1f;
|
||||
}
|
||||
|
||||
int num487 = (int)projectile.ai[0];
|
||||
float num488 = 5f;
|
||||
if (Main.player[num487].lifeMagnet)
|
||||
@@ -72,7 +73,6 @@ namespace CalamityMod.Projectiles.Healing
|
||||
float num495 = -(projectile.velocity.Y * 0.334f);
|
||||
int num496 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 100, default, 0.5f);
|
||||
Main.dust[num496].noGravity = true;
|
||||
Main.dust[num496].velocity *= 0f;
|
||||
Dust expr_153E2_cp_0 = Main.dust[num496];
|
||||
expr_153E2_cp_0.position.X -= num494;
|
||||
Dust expr_15401_cp_0 = Main.dust[num496];
|
||||
@@ -81,7 +81,6 @@ namespace CalamityMod.Projectiles.Healing
|
||||
float num499 = -(projectile.velocity.Y * 0.2f);
|
||||
int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 100, default, 0.7f);
|
||||
Main.dust[num500].noGravity = true;
|
||||
Main.dust[num500].velocity *= 0f;
|
||||
Dust expr_154F9_cp_0 = Main.dust[num500];
|
||||
expr_154F9_cp_0.position.X -= num498;
|
||||
Dust expr_15518_cp_0 = Main.dust[num500];
|
||||
|
||||
@@ -22,50 +22,45 @@ namespace CalamityMod.Projectiles.Healing
|
||||
projectile.extraUpdates = 3;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
int num487 = (int)projectile.ai[0];
|
||||
float num488 = 6.5f;
|
||||
public override void AI()
|
||||
{
|
||||
int num487 = (int)projectile.ai[0];
|
||||
float num488 = 6.5f;
|
||||
if (Main.player[num487].lifeMagnet)
|
||||
num488 *= 1.5f;
|
||||
|
||||
Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
float num489 = Main.player[num487].Center.X - vector36.X;
|
||||
float num490 = Main.player[num487].Center.Y - vector36.Y;
|
||||
float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490));
|
||||
if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech)
|
||||
{
|
||||
int num492 = (int)projectile.ai[1];
|
||||
Main.player[num487].HealEffect(num492, false);
|
||||
Main.player[num487].statLife += num492;
|
||||
if (Main.player[num487].statLife > Main.player[num487].statLifeMax2)
|
||||
{
|
||||
Main.player[num487].statLife = Main.player[num487].statLifeMax2;
|
||||
}
|
||||
NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
projectile.Kill();
|
||||
}
|
||||
num491 = num488 / num491;
|
||||
num489 *= num491;
|
||||
num490 *= num491;
|
||||
projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f;
|
||||
projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f;
|
||||
for (int num497 = 0; num497 < 1; num497++)
|
||||
{
|
||||
float num498 = projectile.velocity.X * 0.2f * (float)num497;
|
||||
float num499 = -(projectile.velocity.Y * 0.2f) * (float)num497;
|
||||
int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 2f);
|
||||
Main.dust[num500].noGravity = true;
|
||||
Main.dust[num500].velocity *= 0f;
|
||||
Dust expr_154F9_cp_0 = Main.dust[num500];
|
||||
expr_154F9_cp_0.position.X -= num498;
|
||||
Dust expr_15518_cp_0 = Main.dust[num500];
|
||||
expr_15518_cp_0.position.Y -= num499;
|
||||
}
|
||||
return;
|
||||
}
|
||||
float num489 = Main.player[num487].Center.X - vector36.X;
|
||||
float num490 = Main.player[num487].Center.Y - vector36.Y;
|
||||
float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490));
|
||||
if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech)
|
||||
{
|
||||
int num492 = (int)projectile.ai[1];
|
||||
Main.player[num487].HealEffect(num492, false);
|
||||
Main.player[num487].statLife += num492;
|
||||
if (Main.player[num487].statLife > Main.player[num487].statLifeMax2)
|
||||
{
|
||||
Main.player[num487].statLife = Main.player[num487].statLifeMax2;
|
||||
}
|
||||
NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
projectile.Kill();
|
||||
}
|
||||
num491 = num488 / num491;
|
||||
num489 *= num491;
|
||||
num490 *= num491;
|
||||
projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f;
|
||||
projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f;
|
||||
float num498 = projectile.velocity.X * 0.2f;
|
||||
float num499 = -(projectile.velocity.Y * 0.2f);
|
||||
int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 2f);
|
||||
Main.dust[num500].noGravity = true;
|
||||
Dust expr_154F9_cp_0 = Main.dust[num500];
|
||||
expr_154F9_cp_0.position.X -= num498;
|
||||
Dust expr_15518_cp_0 = Main.dust[num500];
|
||||
expr_15518_cp_0.position.Y -= num499;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21,43 +21,47 @@ namespace CalamityMod.Projectiles.Healing
|
||||
projectile.extraUpdates = 3;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
projectile.velocity.X *= 0.95f;
|
||||
projectile.velocity.Y *= 0.95f;
|
||||
int num487 = (int)projectile.ai[0];
|
||||
Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
float num489 = Main.player[num487].Center.X - vector36.X;
|
||||
float num490 = Main.player[num487].Center.Y - vector36.Y;
|
||||
float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490));
|
||||
if (num491 < (Main.player[num487].lifeMagnet ? 75f : 50f) && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
int num492 = 10;
|
||||
Main.player[num487].HealEffect(num492, false);
|
||||
Main.player[num487].statLife += num492;
|
||||
if (Main.player[num487].statLife > Main.player[num487].statLifeMax2)
|
||||
{
|
||||
Main.player[num487].statLife = Main.player[num487].statLifeMax2;
|
||||
}
|
||||
NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
projectile.Kill();
|
||||
}
|
||||
for (int num497 = 0; num497 < 1; num497++)
|
||||
{
|
||||
float num498 = projectile.velocity.X * 0.2f * (float)num497;
|
||||
float num499 = -(projectile.velocity.Y * 0.2f) * (float)num497;
|
||||
int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1f);
|
||||
Main.dust[num500].noGravity = true;
|
||||
Main.dust[num500].velocity *= 0f;
|
||||
Dust expr_154F9_cp_0 = Main.dust[num500];
|
||||
expr_154F9_cp_0.position.X -= num498;
|
||||
Dust expr_15518_cp_0 = Main.dust[num500];
|
||||
expr_15518_cp_0.position.Y -= num499;
|
||||
}
|
||||
return;
|
||||
}
|
||||
public override void AI()
|
||||
{
|
||||
projectile.velocity.X *= 0.95f;
|
||||
projectile.velocity.Y *= 0.95f;
|
||||
int num487 = (int)projectile.ai[0];
|
||||
Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
float num489 = Main.player[num487].Center.X - vector36.X;
|
||||
float num490 = Main.player[num487].Center.Y - vector36.Y;
|
||||
float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490));
|
||||
if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
int num492 = 10;
|
||||
Main.player[num487].HealEffect(num492, false);
|
||||
Main.player[num487].statLife += num492;
|
||||
if (Main.player[num487].statLife > Main.player[num487].statLifeMax2)
|
||||
{
|
||||
Main.player[num487].statLife = Main.player[num487].statLifeMax2;
|
||||
}
|
||||
NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
projectile.Kill();
|
||||
}
|
||||
if (Main.player[num487].lifeMagnet && projectile.timeLeft < 360)
|
||||
{
|
||||
float num488 = 6f;
|
||||
num491 = num488 / num491;
|
||||
num489 *= num491;
|
||||
num490 *= num491;
|
||||
projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f;
|
||||
projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f;
|
||||
}
|
||||
float num498 = projectile.velocity.X * 0.2f;
|
||||
float num499 = -(projectile.velocity.Y * 0.2f);
|
||||
int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1f);
|
||||
Main.dust[num500].noGravity = true;
|
||||
Dust expr_154F9_cp_0 = Main.dust[num500];
|
||||
expr_154F9_cp_0.position.X -= num498;
|
||||
Dust expr_15518_cp_0 = Main.dust[num500];
|
||||
expr_15518_cp_0.position.Y -= num499;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Healing
|
||||
float num489 = Main.player[num487].Center.X - vector36.X;
|
||||
float num490 = Main.player[num487].Center.Y - vector36.Y;
|
||||
float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490));
|
||||
if (num491 < (Main.player[num487].lifeMagnet ? 75f : 50f) && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y)
|
||||
if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
@@ -46,16 +46,23 @@ namespace CalamityMod.Projectiles.Healing
|
||||
}
|
||||
projectile.Kill();
|
||||
}
|
||||
float num498 = projectile.velocity.X * 0.2f * 1f;
|
||||
float num499 = -(projectile.velocity.Y * 0.2f) * 1f;
|
||||
if (Main.player[num487].lifeMagnet && projectile.timeLeft < 120)
|
||||
{
|
||||
float num488 = 12f;
|
||||
num491 = num488 / num491;
|
||||
num489 *= num491;
|
||||
num490 *= num491;
|
||||
projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f;
|
||||
projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f;
|
||||
}
|
||||
float num498 = projectile.velocity.X * 0.2f;
|
||||
float num499 = -(projectile.velocity.Y * 0.2f);
|
||||
int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 66, 0f, 0f, 100, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1f);
|
||||
Main.dust[num500].noGravity = true;
|
||||
Main.dust[num500].velocity *= 0f;
|
||||
Dust expr_154F9_cp_0 = Main.dust[num500];
|
||||
expr_154F9_cp_0.position.X -= num498;
|
||||
Dust expr_15518_cp_0 = Main.dust[num500];
|
||||
expr_15518_cp_0.position.Y -= num499;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -57,7 +57,6 @@ namespace CalamityMod.Projectiles.Healing
|
||||
float num495 = -(projectile.velocity.Y * 0.334f) * (float)num493;
|
||||
int num496 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 20, 0f, 0f, 100, default, 1.1f);
|
||||
Main.dust[num496].noGravity = true;
|
||||
Main.dust[num496].velocity *= 0f;
|
||||
Dust expr_153E2_cp_0 = Main.dust[num496];
|
||||
expr_153E2_cp_0.position.X -= num494;
|
||||
Dust expr_15401_cp_0 = Main.dust[num496];
|
||||
@@ -69,7 +68,6 @@ namespace CalamityMod.Projectiles.Healing
|
||||
float num499 = -(projectile.velocity.Y * 0.2f) * (float)num497;
|
||||
int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 20, 0f, 0f, 100, default, 1.3f);
|
||||
Main.dust[num500].noGravity = true;
|
||||
Main.dust[num500].velocity *= 0f;
|
||||
Dust expr_154F9_cp_0 = Main.dust[num500];
|
||||
expr_154F9_cp_0.position.X -= num498;
|
||||
Dust expr_15518_cp_0 = Main.dust[num500];
|
||||
|
||||
@@ -22,44 +22,49 @@ namespace CalamityMod.Projectiles.Healing
|
||||
projectile.timeLeft = 360;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
projectile.velocity.X *= 0.95f;
|
||||
projectile.velocity.Y *= 0.95f;
|
||||
int num487 = (int)projectile.ai[0];
|
||||
Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
float num489 = Main.player[num487].Center.X - vector36.X;
|
||||
float num490 = Main.player[num487].Center.Y - vector36.Y;
|
||||
float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490));
|
||||
if (num491 < (Main.player[num487].lifeMagnet ? 37.5f : 25f) && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
int num492 = 9;
|
||||
Main.player[num487].HealEffect(num492, false);
|
||||
Main.player[num487].statLife += num492;
|
||||
if (Main.player[num487].statLife > Main.player[num487].statLifeMax2)
|
||||
{
|
||||
Main.player[num487].statLife = Main.player[num487].statLifeMax2;
|
||||
}
|
||||
NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
projectile.Kill();
|
||||
}
|
||||
for (int num497 = 0; num497 < 1; num497++)
|
||||
{
|
||||
float num498 = projectile.velocity.X * 0.2f * (float)num497;
|
||||
float num499 = -(projectile.velocity.Y * 0.2f) * (float)num497;
|
||||
int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 1f);
|
||||
Main.dust[num500].noGravity = true;
|
||||
Main.dust[num500].velocity *= 0f;
|
||||
Dust expr_154F9_cp_0 = Main.dust[num500];
|
||||
expr_154F9_cp_0.position.X -= num498;
|
||||
Dust expr_15518_cp_0 = Main.dust[num500];
|
||||
expr_15518_cp_0.position.Y -= num499;
|
||||
}
|
||||
return;
|
||||
}
|
||||
public override void AI()
|
||||
{
|
||||
projectile.velocity.X *= 0.95f;
|
||||
projectile.velocity.Y *= 0.95f;
|
||||
|
||||
int num487 = (int)projectile.ai[0];
|
||||
Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
float num489 = Main.player[num487].Center.X - vector36.X;
|
||||
float num490 = Main.player[num487].Center.Y - vector36.Y;
|
||||
float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490));
|
||||
if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
int num492 = 9;
|
||||
Main.player[num487].HealEffect(num492, false);
|
||||
Main.player[num487].statLife += num492;
|
||||
if (Main.player[num487].statLife > Main.player[num487].statLifeMax2)
|
||||
{
|
||||
Main.player[num487].statLife = Main.player[num487].statLifeMax2;
|
||||
}
|
||||
NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
projectile.Kill();
|
||||
}
|
||||
if (Main.player[num487].lifeMagnet && projectile.timeLeft < 300)
|
||||
{
|
||||
float num488 = 8f;
|
||||
num491 = num488 / num491;
|
||||
num489 *= num491;
|
||||
num490 *= num491;
|
||||
projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f;
|
||||
projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f;
|
||||
}
|
||||
float num498 = projectile.velocity.X * 0.2f;
|
||||
float num499 = -(projectile.velocity.Y * 0.2f);
|
||||
int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 1f);
|
||||
Main.dust[num500].noGravity = true;
|
||||
Dust expr_154F9_cp_0 = Main.dust[num500];
|
||||
expr_154F9_cp_0.position.X -= num498;
|
||||
Dust expr_15518_cp_0 = Main.dust[num500];
|
||||
expr_15518_cp_0.position.Y -= num499;
|
||||
}
|
||||
|
||||
public override void Kill(int timeLeft)
|
||||
{
|
||||
|
||||
@@ -20,61 +20,56 @@ namespace CalamityMod.Projectiles.Healing
|
||||
projectile.extraUpdates = 10;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
int num487 = (int)projectile.ai[0];
|
||||
float num488 = 6.5f;
|
||||
public override void AI()
|
||||
{
|
||||
int num487 = (int)projectile.ai[0];
|
||||
float num488 = 6.5f;
|
||||
if (Main.player[num487].lifeMagnet)
|
||||
num488 *= 1.5f;
|
||||
|
||||
Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
float num489 = Main.player[num487].Center.X - vector36.X;
|
||||
float num490 = Main.player[num487].Center.Y - vector36.Y;
|
||||
float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490));
|
||||
if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech)
|
||||
{
|
||||
int num492 = (int)projectile.ai[1];
|
||||
Main.player[num487].HealEffect(num492, false);
|
||||
Main.player[num487].statLife += num492;
|
||||
if (Main.player[num487].statLife > Main.player[num487].statLifeMax2)
|
||||
{
|
||||
Main.player[num487].statLife = Main.player[num487].statLifeMax2;
|
||||
}
|
||||
NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
projectile.Kill();
|
||||
}
|
||||
num491 = num488 / num491;
|
||||
num489 *= num491;
|
||||
num490 *= num491;
|
||||
projectile.velocity.X = (projectile.velocity.X * 9f + num489) / 16f;
|
||||
projectile.velocity.Y = (projectile.velocity.Y * 9f + num490) / 16f;
|
||||
for (int num493 = 0; num493 < 1; num493++)
|
||||
{
|
||||
float num494 = projectile.velocity.X * 0.334f * (float)num493;
|
||||
float num495 = -(projectile.velocity.Y * 0.334f) * (float)num493;
|
||||
int num496 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 183, 0f, 0f, 100, default, 0.7f);
|
||||
Main.dust[num496].noGravity = true;
|
||||
Main.dust[num496].velocity *= 0f;
|
||||
Dust expr_153E2_cp_0 = Main.dust[num496];
|
||||
expr_153E2_cp_0.position.X -= num494;
|
||||
Dust expr_15401_cp_0 = Main.dust[num496];
|
||||
expr_15401_cp_0.position.Y -= num495;
|
||||
}
|
||||
for (int num497 = 0; num497 < 2; num497++)
|
||||
{
|
||||
float num498 = projectile.velocity.X * 0.2f * (float)num497;
|
||||
float num499 = -(projectile.velocity.Y * 0.2f) * (float)num497;
|
||||
int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 183, 0f, 0f, 100, default, 0.9f);
|
||||
Main.dust[num500].noGravity = true;
|
||||
Main.dust[num500].velocity *= 0f;
|
||||
Dust expr_154F9_cp_0 = Main.dust[num500];
|
||||
expr_154F9_cp_0.position.X -= num498;
|
||||
Dust expr_15518_cp_0 = Main.dust[num500];
|
||||
expr_15518_cp_0.position.Y -= num499;
|
||||
}
|
||||
}
|
||||
float num489 = Main.player[num487].Center.X - vector36.X;
|
||||
float num490 = Main.player[num487].Center.Y - vector36.Y;
|
||||
float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490));
|
||||
if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech)
|
||||
{
|
||||
int num492 = (int)projectile.ai[1];
|
||||
Main.player[num487].HealEffect(num492, false);
|
||||
Main.player[num487].statLife += num492;
|
||||
if (Main.player[num487].statLife > Main.player[num487].statLifeMax2)
|
||||
{
|
||||
Main.player[num487].statLife = Main.player[num487].statLifeMax2;
|
||||
}
|
||||
NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
projectile.Kill();
|
||||
}
|
||||
num491 = num488 / num491;
|
||||
num489 *= num491;
|
||||
num490 *= num491;
|
||||
projectile.velocity.X = (projectile.velocity.X * 9f + num489) / 16f;
|
||||
projectile.velocity.Y = (projectile.velocity.Y * 9f + num490) / 16f;
|
||||
float num494 = projectile.velocity.X * 0.334f;
|
||||
float num495 = -(projectile.velocity.Y * 0.334f);
|
||||
int num496 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 183, 0f, 0f, 100, default, 0.7f);
|
||||
Main.dust[num496].noGravity = true;
|
||||
Dust expr_153E2_cp_0 = Main.dust[num496];
|
||||
expr_153E2_cp_0.position.X -= num494;
|
||||
Dust expr_15401_cp_0 = Main.dust[num496];
|
||||
expr_15401_cp_0.position.Y -= num495;
|
||||
for (int num497 = 0; num497 < 2; num497++)
|
||||
{
|
||||
float num498 = projectile.velocity.X * 0.2f * (float)num497;
|
||||
float num499 = -(projectile.velocity.Y * 0.2f) * (float)num497;
|
||||
int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 183, 0f, 0f, 100, default, 0.9f);
|
||||
Main.dust[num500].noGravity = true;
|
||||
Dust expr_154F9_cp_0 = Main.dust[num500];
|
||||
expr_154F9_cp_0.position.X -= num498;
|
||||
Dust expr_15518_cp_0 = Main.dust[num500];
|
||||
expr_15518_cp_0.position.Y -= num499;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,49 +22,45 @@ namespace CalamityMod.Projectiles.Healing
|
||||
projectile.extraUpdates = 3;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
int num487 = (int)projectile.ai[0];
|
||||
float num488 = 5.5f;
|
||||
public override void AI()
|
||||
{
|
||||
int num487 = (int)projectile.ai[0];
|
||||
float num488 = 5.5f;
|
||||
if (Main.player[num487].lifeMagnet)
|
||||
num488 *= 1.5f;
|
||||
|
||||
Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
float num489 = Main.player[num487].Center.X - vector36.X;
|
||||
float num490 = Main.player[num487].Center.Y - vector36.Y;
|
||||
float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490));
|
||||
if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech)
|
||||
{
|
||||
int num492 = (int)projectile.ai[1];
|
||||
Main.player[num487].HealEffect(num492, false);
|
||||
Main.player[num487].statLife += num492;
|
||||
if (Main.player[num487].statLife > Main.player[num487].statLifeMax2)
|
||||
{
|
||||
Main.player[num487].statLife = Main.player[num487].statLifeMax2;
|
||||
}
|
||||
NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
projectile.Kill();
|
||||
}
|
||||
num491 = num488 / num491;
|
||||
num489 *= num491;
|
||||
num490 *= num491;
|
||||
projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f;
|
||||
projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f;
|
||||
for (int num497 = 0; num497 < 1; num497++)
|
||||
{
|
||||
float num498 = projectile.velocity.X * 0.2f * (float)num497;
|
||||
float num499 = -(projectile.velocity.Y * 0.2f) * (float)num497;
|
||||
int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 58, 0f, 0f, 100, default, 2f);
|
||||
Main.dust[num500].noGravity = true;
|
||||
Main.dust[num500].velocity *= 0f;
|
||||
Dust expr_154F9_cp_0 = Main.dust[num500];
|
||||
expr_154F9_cp_0.position.X -= num498;
|
||||
Dust expr_15518_cp_0 = Main.dust[num500];
|
||||
expr_15518_cp_0.position.Y -= num499;
|
||||
}
|
||||
}
|
||||
Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
float num489 = Main.player[num487].Center.X - vector36.X;
|
||||
float num490 = Main.player[num487].Center.Y - vector36.Y;
|
||||
float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490));
|
||||
if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech)
|
||||
{
|
||||
int num492 = (int)projectile.ai[1];
|
||||
Main.player[num487].HealEffect(num492, false);
|
||||
Main.player[num487].statLife += num492;
|
||||
if (Main.player[num487].statLife > Main.player[num487].statLifeMax2)
|
||||
{
|
||||
Main.player[num487].statLife = Main.player[num487].statLifeMax2;
|
||||
}
|
||||
NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
projectile.Kill();
|
||||
}
|
||||
num491 = num488 / num491;
|
||||
num489 *= num491;
|
||||
num490 *= num491;
|
||||
projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f;
|
||||
projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f;
|
||||
float num498 = projectile.velocity.X * 0.2f;
|
||||
float num499 = -(projectile.velocity.Y * 0.2f);
|
||||
int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 58, 0f, 0f, 100, default, 2f);
|
||||
Main.dust[num500].noGravity = true;
|
||||
Dust expr_154F9_cp_0 = Main.dust[num500];
|
||||
expr_154F9_cp_0.position.X -= num498;
|
||||
Dust expr_15518_cp_0 = Main.dust[num500];
|
||||
expr_15518_cp_0.position.Y -= num499;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -41,11 +41,11 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
{
|
||||
projectile.alpha -= 17;
|
||||
}
|
||||
for (int num136 = 0; num136 < 3; num136++)
|
||||
for (int num136 = 0; num136 < 2; num136++)
|
||||
{
|
||||
float x2 = projectile.position.X - projectile.velocity.X / 10f * (float)num136;
|
||||
float y2 = projectile.position.Y - projectile.velocity.Y / 10f * (float)num136;
|
||||
int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, 74, 0f, 0f, 0, default, 0.5f);
|
||||
int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, 74, 0f, 0f, 0, default, 0.8f);
|
||||
Main.dust[num137].alpha = projectile.alpha;
|
||||
Main.dust[num137].position.X = x2;
|
||||
Main.dust[num137].position.Y = y2;
|
||||
|
||||
@@ -49,17 +49,14 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
{
|
||||
projectile.alpha -= 85;
|
||||
}
|
||||
for (int num136 = 0; num136 < 2; num136++)
|
||||
{
|
||||
float x2 = projectile.position.X - projectile.velocity.X / 10f * (float)num136;
|
||||
float y2 = projectile.position.Y - projectile.velocity.Y / 10f * (float)num136;
|
||||
int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, 74, 0f, 0f, 0, default, 0.5f);
|
||||
Main.dust[num137].alpha = projectile.alpha;
|
||||
Main.dust[num137].position.X = x2;
|
||||
Main.dust[num137].position.Y = y2;
|
||||
Main.dust[num137].velocity *= 0f;
|
||||
Main.dust[num137].noGravity = true;
|
||||
}
|
||||
float x2 = projectile.position.X - projectile.velocity.X / 10f;
|
||||
float y2 = projectile.position.Y - projectile.velocity.Y / 10f;
|
||||
int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, 74, 0f, 0f, 0, default, 0.8f);
|
||||
Main.dust[num137].alpha = projectile.alpha;
|
||||
Main.dust[num137].position.X = x2;
|
||||
Main.dust[num137].position.Y = y2;
|
||||
Main.dust[num137].velocity *= 0f;
|
||||
Main.dust[num137].noGravity = true;
|
||||
float num138 = (float)Math.Sqrt((double)(projectile.velocity.X * projectile.velocity.X + projectile.velocity.Y * projectile.velocity.Y));
|
||||
float num139 = projectile.localAI[0];
|
||||
if (num139 == 0f)
|
||||
|
||||
@@ -0,0 +1,251 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
public class FantasyTalismanProj : ModProjectile
|
||||
{
|
||||
int spiritTimer = 0;
|
||||
int stealthTimer = 10;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Talisman");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 3;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 10;
|
||||
projectile.height = 10;
|
||||
projectile.friendly = true;
|
||||
projectile.Calamity().rogue = true;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.aiStyle = 1;
|
||||
aiType = 242;
|
||||
projectile.penetrate = -1;
|
||||
projectile.timeLeft = 600;
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = -1;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
projectile.spriteDirection = projectile.direction = (projectile.velocity.X > 0).ToDirectionInt();
|
||||
projectile.rotation = projectile.velocity.ToRotation() + (projectile.spriteDirection == 1 ? 0f : MathHelper.Pi);
|
||||
if (Main.rand.Next(3) == 0)
|
||||
{
|
||||
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 175, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f);
|
||||
}
|
||||
if (projectile.Calamity().stealthStrike == true && projectile.ai[0] != 1f)
|
||||
{
|
||||
stealthTimer--;
|
||||
if (stealthTimer == 0)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
int sGhost = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ProjectileID.LostSoulFriendly, projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f);
|
||||
Main.projectile[sGhost].Calamity().forceRogue = true;
|
||||
Main.projectile[sGhost].penetrate = 1;
|
||||
Main.projectile[sGhost].timeLeft = 240;
|
||||
}
|
||||
stealthTimer = 10;
|
||||
}
|
||||
}
|
||||
if (projectile.ai[0] == 1f)
|
||||
{
|
||||
projectile.tileCollide = false;
|
||||
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;
|
||||
if (projectile.localAI[0] % 30f == 0f)
|
||||
{
|
||||
flag55 = true;
|
||||
}
|
||||
int num989 = (int)projectile.ai[1];
|
||||
if (projectile.localAI[0] >= (float)(60 * num988))
|
||||
{
|
||||
flag54 = true;
|
||||
}
|
||||
else if (num989 < 0 || num989 >= 200)
|
||||
{
|
||||
flag54 = true;
|
||||
}
|
||||
else if (Main.npc[num989].active && !Main.npc[num989].dontTakeDamage)
|
||||
{
|
||||
projectile.Center = Main.npc[num989].Center - projectile.velocity * 2f;
|
||||
projectile.gfxOffY = Main.npc[num989].gfxOffY;
|
||||
if (flag55)
|
||||
{
|
||||
Main.npc[num989].HitEffect(0, 1.0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
flag54 = true;
|
||||
}
|
||||
if (flag54)
|
||||
{
|
||||
projectile.Kill();
|
||||
}
|
||||
if (projectile.Calamity().stealthStrike == true)
|
||||
{
|
||||
spiritTimer += 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
spiritTimer++;
|
||||
}
|
||||
if (spiritTimer >= 10)
|
||||
{
|
||||
spiritTimer = 0;
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
int spiritDamage = projectile.damage / 2;
|
||||
int[] numArray1 = new int[200];
|
||||
int maxValue1 = 0;
|
||||
int maxValue2 = 0;
|
||||
for (int index = 0; index < 200; ++index)
|
||||
{
|
||||
if (Main.npc[index].CanBeChasedBy((object) projectile, false))
|
||||
{
|
||||
float num2 = Math.Abs(Main.npc[index].position.X + (float) (Main.npc[index].width / 2) - projectile.position.X + (float) (projectile.width / 2)) + Math.Abs(Main.npc[index].position.Y + (float) (Main.npc[index].height / 2) - projectile.position.Y + (float) (projectile.height / 2));
|
||||
if ((double) num2 < 800.0)
|
||||
{
|
||||
if (Collision.CanHit(projectile.position, 1, 1, Main.npc[index].position, Main.npc[index].width, Main.npc[index].height) && (double) num2 > 50.0)
|
||||
{
|
||||
numArray1[maxValue2] = index;
|
||||
++maxValue2;
|
||||
}
|
||||
else if (maxValue2 == 0)
|
||||
{
|
||||
numArray1[maxValue1] = index;
|
||||
++maxValue1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (maxValue1 == 0 && maxValue2 == 0)
|
||||
return;
|
||||
int num3 = maxValue2 <= 0 ? numArray1[Main.rand.Next(maxValue1)] : numArray1[Main.rand.Next(maxValue2)];
|
||||
double num4 = 4.0;
|
||||
float num5 = (float) Main.rand.Next(-100, 101);
|
||||
float num6 = (float) Main.rand.Next(-100, 101);
|
||||
double num7 = Math.Sqrt((double) num5 * (double) num5 + (double) num6 * (double) num6);
|
||||
float num8 = (float) (num4 / num7);
|
||||
float SpeedX = num5 * num8;
|
||||
float SpeedY = num6 * num8;
|
||||
int ghost = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, SpeedX, SpeedY, ProjectileID.SpectreWrath, spiritDamage, 0.0f, projectile.owner, (float) num3, 0.0f);
|
||||
Main.projectile[ghost].Calamity().forceRogue = true;
|
||||
Main.projectile[ghost].penetrate = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection)
|
||||
{
|
||||
Rectangle myRect = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height);
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
for (int i = 0; i < 200; i++)
|
||||
{
|
||||
if (Main.npc[i].active && !Main.npc[i].dontTakeDamage &&
|
||||
((projectile.friendly && (!Main.npc[i].friendly || projectile.type == 318 || (Main.npc[i].type == 22 && projectile.owner < 255 && Main.player[projectile.owner].killGuide) || (Main.npc[i].type == 54 && projectile.owner < 255 && Main.player[projectile.owner].killClothier))) ||
|
||||
(projectile.hostile && Main.npc[i].friendly && !Main.npc[i].dontTakeDamageFromHostiles)) && (projectile.owner < 0 || Main.npc[i].immune[projectile.owner] == 0 || projectile.maxPenetrate == 1))
|
||||
{
|
||||
if (Main.npc[i].noTileCollide || !projectile.ownerHitCheck || projectile.CanHit(Main.npc[i]))
|
||||
{
|
||||
bool flag3;
|
||||
if (Main.npc[i].type == 414)
|
||||
{
|
||||
Rectangle rect = Main.npc[i].getRect();
|
||||
int num5 = 8;
|
||||
rect.X -= num5;
|
||||
rect.Y -= num5;
|
||||
rect.Width += num5 * 2;
|
||||
rect.Height += num5 * 2;
|
||||
flag3 = projectile.Colliding(myRect, rect);
|
||||
}
|
||||
else
|
||||
{
|
||||
flag3 = projectile.Colliding(myRect, Main.npc[i].getRect());
|
||||
}
|
||||
if (flag3)
|
||||
{
|
||||
if (Main.npc[i].reflectingProjectiles && projectile.CanReflect())
|
||||
{
|
||||
Main.npc[i].ReflectProjectile(projectile.whoAmI);
|
||||
return;
|
||||
}
|
||||
projectile.ai[0] = 1f;
|
||||
projectile.ai[1] = (float)i;
|
||||
projectile.velocity = (Main.npc[i].Center - projectile.Center) * 0.75f;
|
||||
projectile.netUpdate = true;
|
||||
projectile.StatusNPC(i);
|
||||
int num28 = 3;
|
||||
Point[] array2 = new Point[num28];
|
||||
int num29 = 0;
|
||||
for (int l = 0; l < 1000; l++)
|
||||
{
|
||||
if (l != projectile.whoAmI && Main.projectile[l].active && Main.projectile[l].owner == Main.myPlayer && Main.projectile[l].type == projectile.type && Main.projectile[l].ai[0] == 1f && Main.projectile[l].ai[1] == (float)i)
|
||||
{
|
||||
array2[num29++] = new Point(l, Main.projectile[l].timeLeft);
|
||||
if (num29 >= array2.Length)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (num29 >= array2.Length)
|
||||
{
|
||||
int num30 = 0;
|
||||
for (int m = 1; m < array2.Length; m++)
|
||||
{
|
||||
if (array2[m].Y < array2[num30].Y)
|
||||
{
|
||||
num30 = m;
|
||||
}
|
||||
}
|
||||
Main.projectile[array2[num30].X].Kill();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox)
|
||||
{
|
||||
if (targetHitbox.Width > 8 && targetHitbox.Height > 8)
|
||||
{
|
||||
targetHitbox.Inflate(-targetHitbox.Width / 8, -targetHitbox.Height / 8);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
if (projectile.timeLeft > 240)
|
||||
{
|
||||
projectile.timeLeft = 240;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 328 B |